@extends('index') @section('title', Helper::getSiteTitle(isset($title) && !empty($title) ? $title : '')) @section('content') @php $images = DB::table('product_images') ->where('product_id', $product->id) ->where('width_type', 1) ->whereNull('deleted_at') ->orderBy('is_default', 'desc') ->get(); $variants = DB::table('product_variants') ->where('product_id', $product->id) ->where('store_id', $store->id) ->where('selling_price', '>', 0) ->whereNull('deleted_at') ->orderBy('size_order', 'asc') ->select(['id', 'color_name', 'size', 'instock', 'selling_price']) ->get(); $sizes = DB::table('product_variants') ->where('product_id', $product->id) ->where('store_id', $store->id) ->where('selling_price', '>', 0) ->whereNull('deleted_at') ->whereNotNull('size') ->orderBy('size_order', 'asc') ->groupBy('size') ->select(['size', 'id', 'selling_price']) ->get(); $stock = DB::table('product_variants') ->where('product_id', $product->id) ->where('store_id', $store->id) ->where('selling_price', '>', 0) ->whereNull('deleted_at') ->sum('instock'); if(!empty($stock) && !empty($product->par_level) && $stock >= $product->par_level) { $stock = $product->par_level; } $effect_ids = DB::table('product_effects')->where('product_id', $product->id)->pluck('effect_id')->toArray(); $brand = DB::table('product_brands')->where('id', $product->brand_id)->where('active', 1)->whereNull('deleted_at')->first(); $product_dominant_terpenes = DB::table('product_dominant_terpene')->where('product_id', $product->id)->get(); $related_products = $effects = null; if(!empty($effect_ids)) { $effects = DB::table('effects')->whereIn('id', $effect_ids)->where('active', 1)->get(); } if(!empty($category)) { $query_data = ['category' => $category]; if (!empty($category->sub_categories_ids)) { # code... $query_data['categories'] = json_decode($category->sub_categories_ids, true); } $query_data['exclude_product_ids'] = [$product->id]; $related_products = Helper::getProductsQuery() ->groupBy('products.id') ->orderBy('products.name', 'asc') ->select('products.*') ->take(12) ->get(); } $gtm_details = []; $details = [ 'id' => $product->id, 'name' => $product->name, 'list_name' => 'Search Results' ]; if(!empty($brand)) { $details['brand'] = $brand->name; } if(!empty($category)) { $details['category'] = $category->name; } $details['list_position'] = 1; $details['quantity'] = $stock; $details['price'] = $product->selling_price; $gtm_details[] = $details; $sale_data = Helper::productSaleStatus($product); @endphp
@include('includes.warning')
@include('includes.products_filter', ['is_product_page' => true])

{{ $product->name }}

@if($sale_data)
{{ Helper::showCurrencyFormats($sale_data['selling_price']) }} {{ Helper::showCurrencyFormats($sale_data['original_price']) }} {{ $sale_data['sale_percentage'] + 0 }}% OFF
@else
{{ Helper::showCurrencyFormats($product->original_price) }}
@endif @if(!empty($product->type)) {{ $product->type }} @endif @if(!empty($product->thc) || !empty($product->cbd))
@if(!empty($product->thc))
THC (%): {{ Helper::showTHCOrCBD($product->thc) }}
@endif @if(!empty($product->cbd))
CBD (%): {{ Helper::showTHCOrCBD($product->cbd) }}
@endif
@endif @if(!$sizes->isEmpty())
{{ $size->size }}
{{ Helper::showCurrencyFormats($size->selling_price) }}
@endif @if(empty($stock))
Out Of Stock!
@else
@endif
Add to Cart @if(!empty($brand) && (!empty($brand->description) || !empty($brand->image))) @if(!empty($brand->image)) {{ $brand->name }} @endif
{{ $brand->description }}
@endif @if(!empty($product->description))

{{ $product->description }}

@endif @if(!empty($product->flavors)) @php $flavors = json_decode($product->flavors, true); @endphp
@foreach($flavors as $flavor) @php $flavor_code = trim(str_replace('U+', '&#x', $flavor['code'])) . ';'; $flavor_name = null; if(isset($flavor['name']) && !empty($flavor['name'])) { $flavor_name = '
' . $flavor['name'] . ''; } @endphp {!! $flavor_code !!}{!! $flavor_name !!} @endforeach
@endif @if(!empty($effects) && !$effects->isEmpty())
Effects
@foreach($effects as $effect)
@endforeach

Cannabis is a subjective experience. While we base our effects on our staff and user feedback, everyone has a different response to cannabis and results may vary widely.

@endif @if(!empty($product->type) && Helper::getSliderScaleValue($product->type))
Sativa Hybrid Indica
@endif @if(!$product_dominant_terpenes->isEmpty())
Dominant Terpene
@foreach($product_dominant_terpenes as $product_dominant_terpene) {{ $product_dominant_terpene->name }} @endforeach
@endif
@endsection @section('before-gtm') @endsection @section('css-lib') @endsection