@php use App\Models\Category; use App\Models\Brand; use App\Services\TranslationService; use App\Services\CurrencyService; use App\Services\StoreService; use App\Services\MediaService; @endphp
{{-- --}}
{{-- @dd($product_details) --}}
product
{{-- @dd($system_settings) --}}

{{ $product_details->name }}

@php $discount = $product_details->min_max_price['discount_in_percentage'] ?? null; @endphp
@if ($product_details->type != 'variable_product') @php $price = app(CurrencyService::class)->currentCurrencyPrice( $product_details->variants[0]['price'], true, ); $special_price = $product_details->variants[0]['special_price'] && $product_details->variants[0]['special_price'] > 0 ? app(CurrencyService::class)->currentCurrencyPrice( $product_details->variants[0]['special_price'], true, ) : $price; @endphp {{ $special_price !== $price ? $price : '' }} {{ $special_price }} @if ($discount) -{{ $discount }}% @endif @else @php $max_price = app(CurrencyService::class)->currentCurrencyPrice( $product_details->min_max_price['max_price'], true, ); $special_min_price = $product_details->min_max_price['special_min_price'] && $product_details->min_max_price['special_min_price'] > 0 ? app(CurrencyService::class)->currentCurrencyPrice( $product_details->min_max_price['special_min_price'], true, ) : $max_price; @endphp {{ $max_price }} - {{ $special_min_price }} @if ($discount) -{{ $discount }}% @endif @endif
{{-- @dd($product_details); --}}
{{ $product_details->short_description }}

@if (!empty($product_details->made_in))

{{ labels('front_messages.made_in', 'Made In') }}:{{ $product_details->made_in }}

@endif @php $category = fetchDetails(Category::class, ['id' => $product_details->category_id], 'slug'); @endphp {!! app(TranslationService::class)->getDynamicTranslation( Category::class, 'name', $product_details->category_id, $language_code, ) !!} @if (!empty($product_details->sku))

{{ labels('front_messages.sku', 'SKU') }}:{{ $product_details->sku }}

@endif @if (count($product_details->tags) >= 1)

@foreach ($product_details->tags as $tag) {!! $tag !!} @endforeach

@endif @if ($product_details->stock_type != '')
{{ labels('front_messages.currently', 'Currently') }} , {{ labels('front_messages.items_in_stock', 'Items are in stock!') }}
@endif

@foreach ($product_details->attributes as $attributes) @php $attribute_ids = explode(',', $attributes['ids']); $attribute_values = explode(',', $attributes['value']); @endphp
    {{-- only change price --}} {{-- @foreach ($attribute_values as $key => $val)
  • {{ $val }}
  • @endforeach --}} @php $variantsCollection = collect($product_details->variants); $uniqueAttributes = array_unique($attribute_values); // dd($uniqueAttributes); @endphp @foreach ($uniqueAttributes as $key => $val) @php // Find the correct variant based on attribute value $variant = $variantsCollection->firstWhere( 'attribute_value_ids', (string) $attribute_ids[$key], ); // Check if the variant image exists, otherwise use the main product image $variantImage = isset($variant->images_md[0]) && !empty($variant->images_md[0]) ? $variant->images_md[0] : $product_details->image; $variantZoomImage = isset($variant->images_md[0]) && !empty($variant->images_md[0]) ? $variant->images_md[0] : $product_details->image; @endphp
  • {{ $val }}
  • @endforeach
@endforeach {{-- @dd($product_details->attributes); --}}
@foreach ($product_details->variants as $variant) @endforeach
total_allowed_quantity }}' step='{{ $product_details->quantity_step_size }}' min='{{ $product_details->minimum_order_quantity }}' />
@php if (count($product_details->variants) <= 1) { $variant_id = $product_details->variants[0]['id']; $variant_price = $product_details->variants[0]['special_price']; } else { $variant_id = ''; $variant_price = ''; } @endphp {{-- {{ dd($product_details)}} --}}

@if ($product_details->product_type == 'digital_product')
{{ labels('front_messages.digital_product', 'Digital Product') }}
@else
@if (!empty($product_details->guarantee_period)) {{ $product_details->guarantee_period }} @else {{ labels('front_messages.no_guarantee', 'No Guarantee') }} @endif
@if (!empty($product_details->warranty_period)) {{ $product_details->warranty_period }} @else {{ labels('front_messages.no_warranty', 'No Warranty') }} @endif
{{ $product_details->is_returnable == 1 ? 'Returnable' : 'Non Returnable' }}
{{ $product_details->cod_allowed == 1 ? 'Cash on Delivery available' : 'Cash on Delivery Not available' }}
@if ($product_details->is_cancelable == 1) {{ labels('front_messages.cancel_till', 'Cancel Till') }} {{ $product_details->cancelable_till }} @else {{ labels('front_messages.non_cancelable', 'Non Cancelable') }} @endif
@endif @if ($product_details->product_type == 'simple_product') @if ($product_details->stock_type != '')

{{ labels('front_messages.availability', 'Availability') }}: @if ($product_details->availability >= 1) {{ labels('front_messages.in_stock', 'In stock') }} @else {{ labels('front_messages.out_of_stock', 'Out of Stock') }} @endif

@endif @else @if ($product_details->variants[0]['stock_type'] != '')

{{ labels('front_messages.availability', 'Availability') }}: @if ($product_details->variants[0]['availability'] >= 1) {{ labels('front_messages.in_stock', 'In stock') }} @else {{ labels('front_messages.out_of_stock', 'Out of Stock') }} @endif

@endif @endif
{{-- @dd($product_details) --}}
|{{ $product_details->seller_rating }}
@if ($product_details->product_type != 'digital_product')
@if ($deliverabilitySettings != false)

{{ labels('front_messages.check_product_deliverability', 'Check Product Deliverability') }}

@if ($deliverabilitySettings[0]->product_deliverability_type == 'city_wise_deliverability')
@else
@endif
@if ($deliverabilitySettings[0]->product_deliverability_type == 'city_wise_deliverability')

{{ labels('front_messages.city_not_on_list', 'If your city is not on the list') }} {{ labels('front_messages.cannot_deliver', 'we cannot deliver the product there') }}.

@endif

@endif @endif
{{-- @dd($product_details); --}} @if ($siblingsProduct['previous_product'] != null) @php $previous_product_img = app(MediaService::class)->dynamic_image( $siblingsProduct['previous_product']['image'], 200, ); @endphp {{ $siblingsProduct['previous_product']['name'] }} {{ app(CurrencyService::class)->currentCurrencyPrice( (float) ($siblingsProduct['previous_product']['min_max_price']['special_min_price'] > 0 ? $siblingsProduct['previous_product']['min_max_price']['special_min_price'] : $siblingsProduct['previous_product']['min_max_price']['min_price']), true, ) }} {{ $siblingsProduct['previous_product']['name'] }} @endif @if ($siblingsProduct['next_product'] != null) @php $next_product_img = app(MediaService::class)->dynamic_image( $siblingsProduct['next_product']['image'], 200, ); @endphp {{ $siblingsProduct['next_product']['name'] }} {{ $siblingsProduct['next_product']['name'] }} {{ app(CurrencyService::class)->currentCurrencyPrice( (float) ($siblingsProduct['next_product']['min_max_price']['special_min_price'] > 0 ? $siblingsProduct['next_product']['min_max_price']['special_min_price'] : $siblingsProduct['next_product']['min_max_price']['min_price']), true, ) }} @endif
@if ($product_details->description != '')

{{ labels('front_messages.description', 'Description') }}

{!! $product_details->description !!}
{!! $product_details->extra_description !!}
@endif @if ($product_details->attributes != [])

{{ labels('front_messages.additional_information', 'Additional Information') }}

@foreach ($product_details->attributes as $attributes) {{-- @dd($attributes) --}} @endforeach
{{ $attributes['name'] }} {{ $attributes['value'] }}
@endif

{{ labels('front_messages.reviews', 'Reviews') }}

@if (count($relative_products) >= 1)
@php $heading['title'] = labels('front_messages.related_products', 'Related Products'); $heading['short_description'] = labels('front_messages.products_related_to', 'Products Related to ') . $product_details->name; @endphp @php $store_settings = app(StoreService::class)->getStoreSettings(); @endphp
@foreach ($relative_products as $details)
@php $store_settings = app(StoreService::class)->getStoreSettings(); $component = getProductDisplayComponent($store_settings); $details = (object) $details; @endphp
@endforeach
@endif
@php $image = app(MediaService::class)->dynamic_image($product_details->image, 200); @endphp
{{ $product_details->name }}
@php if ($product_details->type != 'variable_product') { $price = app(CurrencyService::class)->currentCurrencyPrice( $product_details->variants[0]['price'], true, ); $special_price = isset($product_details->variants[0]['special_price']) && $product_details->variants[0]['special_price'] > 0 ? app(CurrencyService::class)->currentCurrencyPrice( $product_details->variants[0]['special_price'], true, ) : $price; } else { $max_price = app(CurrencyService::class)->currentCurrencyPrice( $product_details->min_max_price['max_price'], true, ); $special_min_price = isset($product_details->min_max_price['special_min_price']) && $product_details->min_max_price['special_min_price'] > 0 ? app(CurrencyService::class)->currentCurrencyPrice( $product_details->min_max_price['special_min_price'], true, ) : $max_price; } @endphp @if ($product_details->type != 'variable_product') {{ $special_price }} @else {{ $max_price }} - {{ $special_min_price }} @endif
total_allowed_quantity }}' step='{{ $product_details->quantity_step_size }}' min='{{ $product_details->minimum_order_quantity }}' />