@extends('user-front.layout') @php $user = $user ?? (app('user') ?? getUser()); $username = $user ? $user->username : ''; @endphp @section('page-title', $product->title ?? ($keywords['Product_Details'] ?? __('Product Details'))) @section('breadcrumb_title', $product->title ?? ($keywords['Product_Details'] ?? __('Product Details'))) @section('breadcrumb_second_title', $keywords['Product_Details'] ?? __('Product Details')) @section('og-meta') @endsection @section('content')
@php $placeholderImg = asset('assets/front/images/placeholder.png'); $mainSliderSrc = user_item_image_url($product->item->thumbnail ?? '', 'slider'); $thumbnailSrc = user_item_image_url($product->item->thumbnail ?? '', 'thumbnail'); $slidesList = []; $itemId = $product->item_id ?? ($product->item->id ?? null); $itemSliders = $product->item->sliders ?? collect(); if (($itemSliders->isEmpty()) && !empty($itemId)) { $itemSliders = \App\Models\User\UserItemImage::where('item_id', $itemId)->get(); } if ($itemSliders->count() > 1) { foreach ($itemSliders as $s) { $imgName = $s->image ?? ''; if (!empty($imgName) && $imgName !== 'noimage.jpg') { $sSrc = user_item_image_url($imgName, 'slider'); if (!empty($sSrc) && !in_array($sSrc, $slidesList)) { $slidesList[] = $sSrc; } } } } // Auto-resolve multi-image gallery from master SQL / thumbnail matching if DB only has <= 1 image if (count($slidesList) <= 1) { $resolvedImgs = \App\Http\Helpers\ItemImageSqlHelper::resolveSliderImagesForItem($product->item ?? null); if (!empty($resolvedImgs) && count($resolvedImgs) > 1) { $slidesList = []; foreach ($resolvedImgs as $imgName) { $sSrc = user_item_image_url($imgName, 'slider'); if (!empty($sSrc) && !in_array($sSrc, $slidesList) && $sSrc !== $placeholderImg) { $slidesList[] = $sSrc; } } } } if (empty($slidesList)) { if (!empty($mainSliderSrc) && $mainSliderSrc !== $placeholderImg) { $slidesList[] = $mainSliderSrc; } else { $slidesList[] = $placeholderImg; } } @endphp
@php $item_label = DB::table('labels')->where('id', $product->label_id)->first(); $label = $item_label->name ?? null; $color = $item_label->color ?? null; @endphp

{{ $product->title }} {{ $label }}

    @php $avgreview = \App\Models\User\UserItemReview::where('item_id', $product->item->id)->avg('review'); @endphp
    @if ($shop_settings->item_rating_system == 1)
    {{ number_format($avgreview, 1) }} ({{ reviewCount($product->item->id) }} {{ reviewCount($product->item->id) == 1 ? $keywords['Review'] ?? __('Review') : $keywords['Reviews'] ?? __('Reviews') }})
    @endif
    @if ($product->item->type == 'physical') @php $varitaion_stock = VariationStock($product->item->id); @endphp @if ($varitaion_stock['has_variation'] == 'yes') @if ($varitaion_stock['stock'] == 'yes') {{ $keywords['In Stock'] ?? __('In Stock') }} @else {{ $keywords['Out of Stock'] ?? __('Out of Stock') }} @endif @else @if ($product->item->stock > 0) {{ $keywords['In Stock'] ?? __('In Stock') }} @else {{ $keywords['Out of Stock'] ?? __('Out of Stock') }} @endif @endif @endif
@php $flash_info = flashAmountStatus($product->item_id, $product->item->current_price); $product_current_price = $flash_info['amount']; $flash_status = $flash_info['status']; @endphp
@if ($flash_status == true)
{{ $userCurrentCurr->symbol_position == 'left' ? $userCurrentCurr->symbol : '' }} {{ currency_converter($product_current_price) }} {{ $userCurrentCurr->symbol_position == 'right' ? $userCurrentCurr->symbol : '' }}
{{ $userCurrentCurr->symbol_position == 'left' ? $userCurrentCurr->symbol : '' }} {{ currency_converter($product->item->current_price) }} {{ $userCurrentCurr->symbol_position == 'right' ? $userCurrentCurr->symbol : '' }}
{{ $product->item->flash_amount }}% {{ $keywords['OFF'] ?? __('OFF') }} @else
{{ $userCurrentCurr->symbol_position == 'left' ? $userCurrentCurr->symbol : '' }} {{ currency_converter($product->item->current_price) }} {{ $userCurrentCurr->symbol_position == 'right' ? $userCurrentCurr->symbol : '' }}
@if ($product->item->previous_price > 0) {{ $userCurrentCurr->symbol_position == 'left' ? $userCurrentCurr->symbol : '' }} {{ currency_converter($product->item->previous_price) }} {{ $userCurrentCurr->symbol_position == 'right' ? $userCurrentCurr->symbol : '' }} @endif
@endif

{{ $product->summary }}

@if ($product->item->sku)
{{ $keywords['SKU'] ?? __('SKU') }} : {{ $product->item->sku }}
@endif @if ($flash_status == true)
{{ $keywords['Days'] ?? __('Days') }}
{{ $keywords['Hours'] ?? __('Hours') }}
{{ $keywords['Mins'] ?? __('Mins') }}
{{ $keywords['Sec'] ?? __('Sec') }}
{{ $product->item->flash_amount }}%
@endif
@if (count($product_variations) > 0) @php $seen_detail_variations = []; @endphp
    @foreach ($product_variations as $product_variation) @php $product_variation_content = App\Models\User\ProductVariationContent::where([ ['product_variation_id', $product_variation->id], ['language_id', $uLang], ])->first(); if (!$product_variation_content) { $product_variation_content = App\Models\User\ProductVariationContent::where('product_variation_id', $product_variation->id)->first(); } $vTitle = function_exists('resolveProductVariationTitle') ? resolveProductVariationTitle($product_variation, $product_variation_content, $uLang, $loop->iteration) : ($product_variation_content?->variation_name ?? ('Option ' . $loop->iteration)); if (isset($seen_detail_variations[$vTitle])) { continue; } $seen_detail_variations[$vTitle] = true; $variant_content_options = App\Models\User\ProductVariantOption::where([ ['product_variation_id', $product_variation->id], ])->get(); @endphp @if (count($variant_content_options) > 0)
  • {{ $vTitle }}:

      @foreach ($variant_content_options as $variant_content_option) @php $variant_option_contents = App\Models\User\ProductVariantOptionContent::where([ ['product_variant_option_id', $variant_content_option->id], ['language_id', $uLang], ])->first(); if (!$variant_option_contents) { $variant_option_contents = App\Models\User\ProductVariantOptionContent::where('product_variant_option_id', $variant_content_option->id)->first(); } $opt_name = function_exists('resolveProductVariantOptionLabel') ? resolveProductVariantOptionLabel($variant_option_contents, $variant_content_option, $uLang) : ($variant_option_contents?->option_name ?? ('Option ' . $variant_content_option->id)); $sup_option_content = make_input_name($opt_name); $id_name = make_input_name($opt_name); $main_id = 'detail_' . $sup_option_content . '_' . $id_name . '_' . $variant_content_option->id; @endphp
    • @endforeach
  • @endif @endforeach
@endif @if ($shop_settings->catalog_mode != 1)
@php $customer_id = Auth::guard('customer')->check() ? Auth::guard('customer')->user()->id : null; $checkWishList = $customer_id ? checkWishList($product->item_id, $customer_id) : false; @endphp
{{ $keywords['Share Now'] ?? __('Share Now') }} :
@endif
{!! replaceBaseUrl($product->description ?? null) !!}
@if ($shop_settings->item_rating_system == 1)

{{ $keywords['Customer Reviews'] ?? __('Customer Reviews') }}

    @foreach ($reviews as $review)
    • {{ !empty(convertUtf8(@$review->customer)) ? convertUtf8(@$review->customer->username) : '' }} ( {{ @$review->created_at->format('F j, Y') }} )

      {{ nl2br(convertUtf8(@$review->comment)) }}

    @endforeach
@if (Auth::guard('customer')->user()) @if (App\Models\User\UserOrderItem::where('customer_id', Auth::guard('customer')->user()->id)->where('item_id', $product->item->id)->exists())
@error('error')

{{ Session::get('error') }}

@enderror

{{ $keywords['Add Your review'] ?? __('Add Your review') }}

@csrf
@endif @else @endif
@endif @if ($shop_settings->disqus_comment_system == 1)
@endif
{{-- Variation Modal Starts --}} @include('user-front.partials.variation-modal') {{-- Variation Modal Ends --}} @if ($shop_settings->catalog_mode != 1) @php $is_xl_breakpoint = in_array($userBs->theme ?? 'grocery', ['pet', 'skinflow', 'jewellery', 'clothing']); $breakpoint_class = $is_xl_breakpoint ? 'd-xl-none' : 'd-lg-none'; @endphp
{{ $product->title }} —
@endif @endsection @section('styles') @if ($shop_settings->catalog_mode != 1) @endif @endsection @section('scripts') @if ($userBs->is_disqus == 1 && in_array('Disqus', $packagePermissions) && $shop_settings->disqus_comment_system == 1) @endif @if ($shop_settings->catalog_mode != 1) @endif @endsection