@foreach ($response as $res)
@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)

{{ __('Top Rated') }}

@endif @if($product->offerCheck && $outStock == false)

{{ formatCurrencyAmount($product->discountPercent) }}% {{ __('off') }}

@endif
@endif {{ __('Image') }}
@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) 1 @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) {{ $i }} @endif @endforeach @endif @if($res->records->pagination->current_page < $lastPage - 3) ... @endif @if($res->records->pagination->current_page < $lastPage - 2) {{ $lastPage }} @endif
@if(!empty($res->records->pagination->next_page_url))

{{ __('Next') }}

@endif
@endif
@if($res->records->pagination->total <= 0)
@php $category = isset($res->records->filter_applied->categories[0]) ? $res->records->filter_applied->categories[0] : null; @endphp

{{ __('Sorry, we couldn’t find any results matching') }} “{{ isset($res->records->filter_applied->keyword[0]) && $res->records->filter_applied->keyword[0] != "" ? $res->records->filter_applied->keyword[0] : $category }}”.

  • {{ __('Check your spelling and try again.') }}
  • {{ __('Try a similar but different search term, like sofa instead of settee.') }}
  • {{ __('Keep your search term simple as our search facility works best with shorter descriptions.') }}
  • {{ __('Try looking within the departments shown below.') }}
  • @endif
    @endforeach