@extends('layouts.app') @section('content') @php $defaultPrice = $product->final_price ?? 0; $defaultMrp = $product->productMrp ?? $product->old_price ?? 0; if(($product->has_price_variant ?? 'no') == 'yes' && isset($product->priceVariants) && $product->priceVariants->count() > 0){ $defaultVariant = $product->priceVariants->sortBy('final_price')->first(); if($defaultVariant){ $defaultPrice = $defaultVariant->final_price ?? 0; $defaultMrp = $defaultVariant->size_mrp ?? 0; } } $defaultDiscountPercent = 0; if($defaultMrp > 0 && $defaultPrice > 0 && $defaultMrp > $defaultPrice){ $defaultDiscountPercent = round((($defaultMrp - $defaultPrice) / $defaultMrp) * 100); } $inCart = in_array($product->id, $cartProductIds ?? []); @endphp
{{ $product->category->categoryName ?? 'Printing Product' }}

{{ $product->productName }}

{{ Str::limit(strip_tags($product->productDescription), 220) ?: 'Premium quality custom printing product with professional finish and fast delivery.' }}

₹{{ number_format($defaultPrice, 2) }} ₹{{ number_format($defaultMrp, 2) }} {{ $defaultDiscountPercent }}% Off
@if(!empty($product->flat_discount) && $product->flat_discount > 0)
Prepaid Offer: If you place a prepaid order, you'll get an instant ₹{{ number_format($product->flat_discount, 0) }} discount.
@endif @if(($product->has_price_variant ?? 'no') == 'yes' && isset($product->priceVariants) && $product->priceVariants->count() > 0)
@foreach($product->priceVariants as $index => $variant) @endforeach
@endif @if(($product->has_color_variant ?? 'no') == 'yes' && isset($product->colorVariants) && $product->colorVariants->count() > 0)
@foreach($product->colorVariants as $index => $color) @endforeach
@endif @if(isset($product->addons) && $product->addons->count() > 0)
@foreach($product->addons as $addon) @endforeach
@endif
@if(($product->stock ?? '') == 'Out of Stock') Out of Stock @else {{ $inCart ? 'Go To Cart' : 'Add To Cart' }} @endif

SKU: PROD-{{ str_pad($product->id, 4, '0', STR_PAD_LEFT) }}

SKU: {{ $product->productCode }}

Category: {{ $product->category->categoryName ?? 'Printing Product' }}

Availability: @if(($product->stock ?? '') == 'Out of Stock') {{ $product->stock }} @elseif(($product->stock ?? '') == 'Low Stock') {{ $product->stock }} @else {{ $product->stock ?? 'Available' }} @endif

Shipping: Delivery available across India

Product Description

{!! $product->productDescription ?: 'This premium product is specially designed for professional printing and customization. It is suitable for business branding, gifting, marketing and personal use.' !!}

Specifications

@if($defaultMrp > 0) @endif @if(isset($product->specifications) && $product->specifications->count() > 0) @foreach($product->specifications as $spec) @endforeach @endif
Product Name {{ $product->productName }}
Category {{ $product->category->categoryName ?? 'Printing Product' }}
Selling Price ₹{{ number_format($defaultPrice, 2) }}
MRP ₹{{ number_format($defaultMrp, 2) }}
Stock Status {{ $product->stock ?? 'Available' }}
{{ $spec->specificationTitle ?? $spec->title ?? 'Specification' }} {{ $spec->specificationValue ?? $spec->value ?? '' }}
Customization Available on request
@if(isset($relatedProducts) && $relatedProducts->count() > 0)
@foreach($relatedProducts as $item) @php $relatedPrice = $item->final_price ?? 0; if(($item->has_price_variant ?? 'no') == 'yes' && isset($item->priceVariants) && $item->priceVariants->count() > 0){ $relatedVariant = $item->priceVariants->sortBy('final_price')->first(); if($relatedVariant){ $relatedPrice = $relatedVariant->final_price ?? 0; } } @endphp
@endforeach
@endif
Added to cart View Cart
@endsection