@php $menu_categories = Cache::remember(App\Enums\Settings\CacheKey::MENU_CATEGORY->value,24 * 60, fn() => App\Models\MenuCategory::with(['category','category.product','category.product.review','category.product.stock'])->orderBy('serial')->get()); $categoryId = []; @endphp @foreach($menu_categories as $category) @if($category->category) {{ @get_translation($category->category->name) }} {{ $category->title ? $category->title :@frontend_section_data($menu_category_section->value,'sub_heading')}} {{translate('View More')}} @php $products = $category->category->product; @endphp @forelse($products as $product) {{translate("Quick View")}} @if($product->discount_percentage > 0) {{translate('off')}} {{round($product->discount_percentage)}} % @endif @php echo show_ratings($product->review->avg('rating')) @endphp {{$product->name}} @php $price = (@$product->stock->first()?->price ?? $product->price); @endphp @if(($product->discount_percentage) > 0) {{short_amount(cal_discount($product->discount_percentage,$price))}} {{short_amount($price)}} @else {{short_amount($price)}} @endif @php $randNum = rand(1,10000000); @endphp {{translate('Add to cart')}} @php $authUser = auth_user('web'); $wishedProducts = $authUser ? $authUser->wishlist->pluck('product_id')->toArray() : []; @endphp @empty @include("frontend.partials.empty",['message' => 'No product found']) @endforelse @php array_push($categoryId,$category->id) @endphp @endif @endforeach @if(@frontend_section_data($promo_banner->value,'position') == 'menu-category') @includeWhen($promo_banner->status == '1', 'frontend.section.promotinal_banner', ['promo_banner' => $promo_banner]) @endif @if(@frontend_section_data($promo_second_banner->value,'position') == 'menu-category') @includeWhen($promo_second_banner->status == '1', 'frontend.section.promotinal_banner', ['promo_banner' => $promo_second_banner]) @endif @push('scriptpush') @endpush
{{ $category->title ? $category->title :@frontend_section_data($menu_category_section->value,'sub_heading')}}