@php $productId = $item->id ?? 0; $productTitle = $item->title ?? ''; $productTitleVi = $item->translate('vi')->title ?? $productTitle; $productTitleEn = $item->translate('en')->title ?? ''; $productSlug = $item->name ?? ''; $productDesc = $item->description ?? ''; $productImage = !empty($item->image ?? '') ? asset($item->image) : ''; $productSalePrice = $item->sale_price ?? 0; $productImportPrice = $item->import_price ?? 0; $productPriceOrigin = $productImportPrice > $productSalePrice ? $productImportPrice : ''; $detailURL = action('HomeController@productdetail', ['name' => $productSlug]); $redirectURL = action('HomeController@cart'); // discount $discountPercent = 0; if($productImportPrice > $productSalePrice && $productImportPrice > 0) { $discountPercent = round(($productImportPrice-$productSalePrice) * 100 / $productImportPrice); } $isDiv = $isDiv ?? false; @endphp @if($isDiv)
{!! $productDesc !!}