@if ($data->show) @php add_js_src(theme_asset('components/common/script.js')); $title = $data->title; $args = []; $routeParams = []; $url = route('web.products'); if($data->list_type == 'collection'){ if($data->collection_id && $collection = $helper->getProductCollection(['id' => $data->collection_id])){ if(!$title) $title = $collection->name; $args = $collection->getProductParams(); $args['@limit'] = $data->limit && $data->limit > 0 ? $data->limit : 4; $routeParams = $collection->urlParams; // $url.="?collection=" . $data->collection_id; } }else{ $args['@limit'] = $data->limit && $data->limit > 0 ? $data->limit : 4; $args['@sorttype'] = $data->sorttype(1); // $url.="?sorttype=" . $data->sorttype(1); if($data->match_label && $data->match_label != 'none' && $data->labels){ $args[$data->match_label == 'all' ? '@matchAllLabel' : '@hasAnyLabel'] = $data->labels; $routeParams['labels'] = implode(',', $data->labels); // $url.="&match_labels=" .implode(',', $data->labels); } if($data->match_tag && $data->match_tag != 'none' && $data->tags){ $args[$data->match_tag == 'all' ? '@matchAllTag' : '@hasAnyTag'] = $data->tags; $routeParams['labels'] = implode(',', $data->labels); // $url.="&match_tags=" .implode(',', $data->tags); } } if($args){ $args = array_merge($args, [ '@with' => ['promoAvailable'], '@withOption' => true, '@withGallery' => true, '@withCategory' => true ]); } @endphp @if ($args && count($products = $helper->getProducts($args)))

{{$title}}

@foreach ($products as $product)
@include($_template.'products.grid-item', [ 'product' => $product, 'item_class' => 'mb-12 mb-lg-20', 'use_thubnail_slide' => true ])
@endforeach
@endif @endif