@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('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('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('selling_price', '>', 0) ->whereNull('deleted_at') ->sum('instock'); $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.selling_price', '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; @endphp {{ $product->name }} @if(!$images->isEmpty()) @foreach($images as $image) @endforeach @endif @if(!$images->isEmpty()) @foreach($images as $image) @endforeach @endif {{ $product->name }} {{ Helper::showCurrencyFormats($product->selling_price) }} @if(!empty($product->original_price) && $product->original_price > $product->selling_price) {{ Helper::showCurrencyFormats($product->original_price) }} @endif @if(!empty($product->type)) {{ strtoupper($product->type) }} @endif @if(!empty($product->thc) || !empty($product->cbd)) @if(!empty($product->thc)) THC (%): {{ $product->thc }} @endif @if(!empty($product->cbd)) CBD: {{ $product->cbd }} @endif @endif @if(!$sizes->isEmpty()) @foreach($sizes as $key => $size) {{ $size->size }} {{ Helper::showCurrencyFormats($size->selling_price) }} @endforeach @endif @if(!empty($product->description)) {!! $product->description !!} @endif @if(!empty($effects) && !$effects->isEmpty()) Effects @foreach($effects as $effect) {!! $effect->svg !!} {{ $effect->name }} @endforeach @endif @if(!empty($stock)) Add to Cart @else Out Of Stock @endif @if(!empty($brand) && (!empty($brand->description) || !empty($brand->image))) About Brand @if(!empty($brand->image)) @endif {!! $brand->description !!} @endif @if(!empty($product->slider_scale)) Scale Indica Hybrid Sativa @endif @if(!$product_dominant_terpenes->isEmpty()) Dominent Terpene @foreach($product_dominant_terpenes as $product_dominant_terpene) {{ $product_dominant_terpene->name }} @endforeach @endif @endsection @section('before-gtm') @endsection
{{ $product_dominant_terpene->name }}