@if($res->records->pagination->total > 0)
{{-- Product list --}}
@php
$layout = \Modules\CMS\Entities\Page::firstWhere('default', '1')->layout;
$isEnableProduct = option($layout . '_template_product', '');
@endphp
@foreach ($res->records->data as $product)
@php
$offerFlag = $product->offerCheck;
$outStock = false;
@endphp
@if (isset($isEnableProduct['badge']) && $isEnableProduct['badge'] == 1)
@if($product->isOutOfStock->outOfStockVisibility == 1)
@php $outStock = true @endphp
{{ __('Stock Out') }}
@endif
@if(isset($product->featured) && $outStock == false)
{{ __('Featured') }}
@endif
@if($product->review_average == 5 && $outStock == false)
@endif
@if($product->offerCheck && $outStock == false)
{{ formatCurrencyAmount($product->discountPercent) }}% {{ __('off') }}
@endif
@endif
@if($product->type == \App\Enums\ProductType::$Simple && $outStock == false && isset($isEnableProduct['add_to_cart']) && $isEnableProduct['add_to_cart'] == 1)
code }}>
@endif
@if (preference('wishlist') && isset($isEnableProduct['wishlist']) && $isEnableProduct['wishlist'] == 1)
@endif
@if (preference('compare') && isset($isEnableProduct['compare']) && $isEnableProduct['compare'] == 1)
@endif
@if (isset($isEnableProduct['badge']) && $isEnableProduct['badge'] == 1 && $product->type != 'Grouped Product')
@elseif(isset($isEnableProduct['badge']) && $isEnableProduct['badge'] == 1)
{{ __('View') }}
@endif
{{ $product->categories[0] ?? null }}
{{ $product->name }}
@if (isset($isEnableProduct['price']) && $isEnableProduct['price'] == 1)
{{ $product->regular_price_formatted }}
@endif
@if (isset($isEnableProduct['review']) && $isEnableProduct['review'] == 1)
@for($i = 1; $i <= 5; $i++)
@if ($product->review_average >= $i)
-
@else
-
@endif
@endfor
-
({{ !empty($product->review_average) ? $product->review_average : 0 }})
@endif
{{ $product->summary }}
@if($product->type == \App\Enums\ProductType::$Simple)
@else
@if (isset($isEnableProduct['quick_view']) && $isEnableProduct['quick_view'] == 1 && $product->type != 'Grouped Product')
@elseif(isset($isEnableProduct['quick_view']) && $isEnableProduct['quick_view'] == 1)
@endif
@endif
@endforeach
@endif
@if ($res->records->pagination->total > $res->records->pagination->rows_per_page)
@php
$lastPage = ceil($res->records->pagination->total / $res->records->pagination->rows_per_page);
$pageUrl = !empty($res->records->pagination->next_page_url) ? $res->records->pagination->next_page_url : $res->records->pagination->prev_page_url;
$nextPageNumber = $res->records->pagination->current_page;
$nextPageNumber = !empty($res->records->pagination->next_page_url) ? $nextPageNumber + 1 : $nextPageNumber - 1;
@endphp
@if(!empty($res->records->pagination->prev_page_url))
{{ __('Prev') }}
@endif
@if($res->records->pagination->current_page > 3)
@endif
@if($res->records->pagination->current_page > 4)
...
@endif
@if($lastPage > 1)
@foreach (range(1, $lastPage) as $i)
@if($i >= $res->records->pagination->current_page - 2 && $i <= $res->records->pagination->current_page + 2)
@endif
@endforeach
@endif
@if($res->records->pagination->current_page < $lastPage - 3)
...
@endif
@if($res->records->pagination->current_page < $lastPage - 2)
@endif
@if(!empty($res->records->pagination->next_page_url))
{{ __('Next') }}
@endif