@extends('layouts.app') @php $storeName = $shopSettings['shop_name'] ?? 'Orange Groceries'; $productTitle = !empty($product->meta_title) ? $product->meta_title : ($product->name . ($product->weight ? ' (' . $product->weight . ')' : '') . ' - ' . $storeName); $productPrice = $product->discount_price ? $product->discount_price : $product->selling_price; $cleanDesc = Str::limit(strip_tags($product->description ?? ''), 150); $productDesc = !empty($product->meta_description) ? $product->meta_description : ('Buy ' . $product->name . ' online at best price of ₹' . $productPrice . ' from ' . $storeName . '.' . ($cleanDesc ? ' ' . $cleanDesc : ' Fast 30-minute delivery to your doorstep.')); $productKeywords = !empty($product->meta_keywords) ? $product->meta_keywords : implode(', ', array_filter([ $product->name, 'buy ' . $product->name . ' online', $product->category->name ?? null, $product->subcategory->name ?? null, $product->brand ?? null, 'grocery online', $storeName ])); $canonicalUrl = !empty($product->canonical_url) ? $product->canonical_url : route('products.show', $product->slug); $productImage = $product->image ? (Str::startsWith($product->image, 'http') ? $product->image : asset($product->image)) : ''; $schemaData = [ "@context" => "https://schema.org/", "@type" => "Product", "name" => $product->name, "image" => $productImage, "description" => $cleanDesc ?: $productDesc, "sku" => $product->sku ?? ('SKU-' . $product->id), "offers" => [ "@type" => "Offer", "url" => route('products.show', $product->slug), "priceCurrency" => "INR", "price" => (string)$productPrice, "availability" => $product->stock_quantity > 0 ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", "itemCondition" => "https://schema.org/NewCondition" ] ]; if (!empty($product->brand)) { $schemaData["brand"] = [ "@type" => "Brand", "name" => $product->brand ]; } @endphp @section('title', $productTitle) @section('meta_description', $productDesc) @section('meta_keywords', $productKeywords) @section('canonical', $canonicalUrl) @section('og_type', 'product') @section('og_image', $productImage) @section('structured_data') @endsection @php $firstVariant = $product->variants->first(); $defaultWeight = $firstVariant ? ($firstVariant->weight ?: $firstVariant->variant_name) : ($product->weight ?? ''); $defaultDiscount = $firstVariant ? $firstVariant->discount_percent : $product->discount_percent; $defaultSku = $firstVariant && $firstVariant->sku ? $firstVariant->sku : ($product->sku ?? 'GROC-PROD'); $defaultBarcode = $firstVariant && $firstVariant->barcode ? $firstVariant->barcode : ($product->barcode ?? ''); @endphp @section('content')
@php $galleryImages = is_array($product->multiple_images) && count($product->multiple_images) > 0 ? array_values(array_filter($product->multiple_images)) : [$product->image]; if (!in_array($product->image, $galleryImages)) { array_unshift($galleryImages, $product->image); } $galleryImages = array_values(array_unique($galleryImages)); @endphp
{{ $product->name }}
@if(count($galleryImages) > 1)
@foreach($galleryImages as $index => $gImg) @endforeach
@endif
{{ $product->brand ?? 'Daily Essentials' }} @if($product->subcategory) • {{ $product->subcategory->name }} @endif

{{ $product->name }}

SKU:

₹{{ number_format($product->effective_price, 2) }} MRP ₹{{ number_format($product->selling_price, 2) }} Inclusive of all taxes (GST {{ $product->gst_percent }}%)
@if($product->variants->count() > 0)
{{ $product->variants->count() }} options available
@foreach($product->variants as $variant)
{{ $variant->variant_name }} @if($variant->stock_quantity <= 0) Out of Stock @endif
{{ $variant->weight ?: $variant->variant_name }} 30 MINS
₹{{ number_format($variant->effective_price, 2) }} @if($variant->selling_price > $variant->effective_price) ₹{{ number_format($variant->selling_price, 2) }} @endif
@if($variant->discount_percent > 0) {{ $variant->discount_percent }}% OFF @endif
@endforeach
@endif
Availability:
@csrf
1
@auth @else @endauth
@csrf @auth @else @endauth

Product Description

{{ $product->description ?? 'High-grade grocery product directly sourced from verified brands and quality suppliers. Guaranteed purity and freshness delivered to your door.' }}

@if(count($relatedProducts) > 0)

Related Products You May Like

@foreach($relatedProducts as $rel) @include('customer.components.product_card', ['product' => $rel]) @endforeach
@endif
@endsection