@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
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()){{ $variant?->variant_value?->name }}
$ {{ $variant->price }}
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
Quantity
Currently unavailable.
@endifPrice
${{ number_format($relateproducts->price ?? 0, 2) }}Price
${{ number_format($recentproduct->price ?? 0, 2) }}