@extends('ecommerce::frontend.layout.main') @section('title') @if($category->page_title) {{$category->page_title}} @else {{ $ecommerce_setting->site_title ?? '' }} @endif @endsection @section('description') @if($category->short_description) {{$category->short_description}} @else @endif @endsection @push('css') @endpush @section('content')
@if(count($variants) > 0)
@php $uniqueVariants = []; foreach ($variants as $variant) { $options = json_decode($variant->variant_option, true); $values = json_decode($variant->variant_value, true); if (is_array($options) && is_array($values)) { foreach ($options as $index => $option) { // Ensure both arrays have the key and add to the unique array if (isset($values[$index])) { if (!isset($uniqueVariants[$option])) { $uniqueVariants[$option] = []; } // Merge unique values $uniqueVariants[$option] = array_unique(array_merge($uniqueVariants[$option], explode(',', $values[$index]))); } } } } @endphp @foreach ($uniqueVariants as $variantType => $options)
{{ $variantType }}
@foreach ($options as $option) @endforeach
@endforeach
@endif
@foreach($products as $product) @include('ecommerce::frontend.includes.product-template') @endforeach @if(count($products) == 0)

Sorry, no products found

@endif
@endsection @section('script')