@extends('frontend.layout.applayout') @section('title', $product->name) @section('main-content') @php use Carbon\Carbon; $special = false; $default_variant = ''; $today = Carbon::today(); $specialPriceFrom = Carbon::today()->toDateString(); $specialPriceTo = $product->special_price_to; if ($specialPriceFrom && $specialPriceTo) { $specialFrom = Carbon::parse($specialPriceFrom); $specialTo = Carbon::parse($specialPriceTo); if ($specialFrom->lte($today) && $specialTo->gte($today)) { $special = true; } } foreach ($product->variants as $variant) { if ($variant?->variant_value?->name == 'Case') { $default_variant = $variant->id; } } @endphp @push('scripts') @endpush

{{ $product->name }} @foreach ($product->variants as $variant) @if ($loop->first || $variant->variant_value?->name == 'Case') - {{ $variant->title }} @endif @endforeach

By {{ $product->brand_name->name ?? 'N/A' }} | | SKU {{ $product->sku }}

Size : {{ $product->variants->first()?->size ?? $product->weight . ' ' . $product->weight_type }}

@if (Auth::guard('customer')->check())
@foreach ($product->variants as $variant)

{{ $variant?->variant_value?->name }}

$ {{ $variant->price }}

@endforeach
@endif @if ($product->quantity_on_hand > 0)

In Stock.

{{ $product->small_description }}

{{--

--}} @if (Auth::guard('customer')->check())

@if ($product->variants->isNotEmpty()) @php $activeVariant = $product->variants->first(); $variantPrice = $activeVariant->price; @endphp ${{ $variantPrice }} @else @if ($special) {{ $product->price }} ${{ $product->special_price }} @else ${{ $product->price }} @endif @endif


@endif

Quantity

@else

Currently unavailable.

@endif

Related Products

@if ($recentViewed->count() != 0)

Recently Viewed Products

@endif
View All Products
@push('scripts') {{-- --}} @endpush @endsection