@extends('frontend.layouts.app', ['title' => 'ZAKH offers elegant and trendy ladies fashion, featuring stylish outfits, accessories, and timeless essentials for the modern woman']) @section('content') @php // $isInWishlist = $wishlist->contains('product_id', $response['id']); $isInWishlist = false; $sessionWishlistData = session('wishlist') ?? []; if (auth()->user()) { $isInWishlist = $wishlist->contains('product_id', $response['id']); } else { foreach ($sessionWishlistData as $key => $value) { // dd($value['product_id'],$response['id']); if ($value['product_id'] == $response['id']) { $isInWishlist = true; } } } @endphp
@php if ($response['product_video']) { array_push($response['images'], ['image' => $response['product_video']]); } foreach ($response['variations'] as $variation) { $response['images'][] = [ 'image' => $variation['image'], ]; } @endphp {{-- @dd($response['images'] ,$response ) --}} @foreach ($response['images'] as $index => $media) @php $extension = pathinfo($media['image'], PATHINFO_EXTENSION); $videoExtensions = [ 'mp4', 'webm', 'ogg', 'mov', 'avi', 'wmv', 'flv', 'mkv', ]; $imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp', 'svg']; $isVideo = in_array(strtolower($extension), $videoExtensions); $isImage = in_array(strtolower($extension), $imageExtensions); $mediaSrc = asset('storage/' . $media['image']); @endphp @endforeach
@foreach ($response['images'] as $index => $media) @php $extension = pathinfo($media['image'], PATHINFO_EXTENSION); $videoExtensions = ['mp4', 'webm', 'ogg', 'mov']; $isVideo = in_array(strtolower($extension), $videoExtensions); $mediaSrc = asset('storage/' . $media['image']); @endphp
@if ($isVideo)
Video thumbnail
@else Product thumbnail @endif
@endforeach

{{ $response['name'] }}

@php $mrp = $response['variations'][0]['mrp'] ?? $response['base_mrp']; $price = $response['variations'][0]['price'] ?? $response['base_price']; $percentOff = $mrp > 0 && $price > 0 ? number_format((($mrp - $price) / $mrp) * 100, 2, '.', '') : 0; @endphp
₹{{ $mrp }}₹{{ number_format($price, 0, '.', ',') }} {{ $percentOff }}% off
{{--

{{ $response['description'] }}

--}} @if (!empty($response['variation_attributes'])) @foreach ($response['variation_attributes'] as $attributeName => $attributeValues) @php // Normalize attribute names $sizeVariants = ['S', 'M', 'L', 'XL', 'XXL', 'XXXL', 'Size']; $isSize = in_array($attributeName, $sizeVariants); $displayName = $isSize ? 'Size' : 'Color'; $attributeType = $isSize ? 'Size' : 'Color'; @endphp
@if ($attributeType === 'Color') {{-- Color Options --}}
    @foreach ($attributeValues as $index => $attribute) @php // Check if this color option has any stock $hasStock = false; if (!empty($response['variations'])) { foreach ($response['variations'] as $variation) { if ($variation['stock'] > 0) { foreach ($variation['attributes'] as $attr) { if ( $attr['name'] === 'Color' && strtolower($attr['value']) === strtolower($attribute['value']) ) { $hasStock = true; break 2; } } } } } $stockClass = $hasStock ? '' : 'out-of-stock-variation'; $colorValue = strtolower(str_replace(' ', '', $attribute['value'])); $uniqueId = 'color-' . ($index + 1); @endphp
  • @endforeach
@else {{-- Size Options --}}
    @foreach ($attributeValues as $index => $attribute) @php // Check if this size option has any stock $hasStock = false; if (!empty($response['variations'])) { foreach ($response['variations'] as $variation) { if ($variation['stock'] > 0) { foreach ($variation['attributes'] as $attr) { if ( $attr['name'] === 'Size' && strtolower($attr['value']) === strtolower($attribute['value']) ) { $hasStock = true; break 2; } } } } } $stockClass = $hasStock ? '' : 'out-of-stock-variation'; $sizeValue = strtolower(str_replace(' ', '', $attribute['value'])); $uniqueId = 'size-' . ($index + 1); @endphp
  • @endforeach
@endif
@endforeach @endif
Size Chart
{{-- @dd($response) --}}
{{-- Product share block (Blade) --}}
Estimated delivery: 3–7 business days
Free shipping & returns {{-- On all orders over ₹50 --}}
Click here to view coupon code
Guarantee safe and secure checkout
Category: {{-- @dd($response) --}} {{ $response['category']->title }}
@if ($response['tags'])
Tags: {{-- @dd($response) --}} {{ $response['tags'] }}
@endif

{!! $response['description'] !!}

{{ $response['info'] }}

{{ $response['shipping'] }}

{{--

MAKE IT A MATCH

@php $totalPrice = 0; @endphp
@foreach ($matchingProducts as $product) @php $totalPrice += $product->base_price; @endphp @if ((int) $product->variation->stock > 0)
Leezy Straight Leg Cargo Pants
{{ $product->product_name }}
₹{{ number_format($product->base_mrp, 0) }} ₹{{ number_format($product->base_price, 0) }}
@endif @endforeach
Total Price: Rs. {{ number_format($totalPrice, 0) }}
--}}
@if (count($matchingProducts) > 0)

MAKE IT A MATCH

@php $totalPrice = 0; @endphp
@foreach ($matchingProducts as $product) {{-- @dd($product->variation) --}} @php $totalPrice += $product->base_price; @endphp @if ((int) $product->variation->stock > 0)
Leezy Straight Leg Cargo Pants
{{ $product->product_name }}
₹{{ number_format($product->base_mrp, 0) }} ₹{{ number_format($product->base_price, 0) }}
@endif @endforeach
Total Price: Rs. {{ number_format($totalPrice, 0) }}
@endif
@if ($recentlyViewedProducts->where('product_id', '!=', $response['id'])->isNotEmpty())

Recently Viewed products

@endif @if ($related_products->where('product_id', '!=', $response['id'])->isNotEmpty()) {{-- Address Create Modal --}} @endif {{-- Script: include once per page (place near the bottom) --}} @endsection