@php $arrProductsLastView = array(); $lastView = empty(\Cookie::get('productsLastView')) ? [] : json_decode(\Cookie::get('productsLastView'), true); if ($lastView) { arsort($lastView); } if ($lastView && count($lastView)) { $lastView = array_slice($lastView, 0, sc_config('product_viewed'), true); $productsLastView = $modelProduct->start()->getProductFromListID(array_keys($lastView))->getData(); foreach ($lastView as $pId => $time) { foreach ($productsLastView as $key => $product) { if ($product['id'] == $pId) { $product['timelastview'] = $time; $arrProductsLastView[] = $product; } } } } @endphp @if (!empty($arrProductsLastView))
{{ sc_language_render('front.products_last_view') }}
@foreach ($arrProductsLastView as $productLastView)
@endforeach
@endif