@php
$gtm_ite_list_details = [];
@endphp
@foreach($products as $product)
@php
$details = [
'id' => $product->id,
'name' => $product->name,
'list_name' => 'Search Results'
];
if(!empty($brand))
{
$details['brand'] = $brand->name;
}
if(!empty($category))
{
$details['category'] = $category->name;
}
$details['list_position'] = 1;
$details['price'] = $product->selling_price;
$gtm_ite_list_details[] = $details;
@endphp
@include('includes.product-item', ['product' => $product, 'store_slug' => $store_slug, 'class_names' => $class_names, 'category' => $category ?? null, 'brand' => $brand ?? null])
@endforeach
@section('before-gtm')
@endsection