@php /** * Style-1 grid card — shop card layout. * Image (with hover) → action overlay → single badge → quick-add → marquee → info block. * No flash-sale countdown overlay here — the demo only shows it inside * dedicated flash-sale sections, not on the standard shop card. * * Inputs: * $product \Botble\Ecommerce\Models\Product * $showQuickView bool * $showQuickShop bool */ use Botble\Base\Facades\BaseHelper; use Botble\Media\Facades\RvMedia; $showQuickView = $showQuickView ?? true; $showQuickShop = $showQuickShop ?? true; $primaryImage = RvMedia::getImageUrl($product->image, 'product-grid', false, RvMedia::getDefaultImage()); $hoverImage = null; if (! empty($product->images) && is_iterable($product->images)) { foreach ($product->images as $img) { if (! is_string($img) || trim($img) === '' || $img === $product->image) { continue; } $hoverImage = RvMedia::getImageUrl($img, 'product-grid', false, null); if ($hoverImage) { break; } } } $isOnSale = $product->front_sale_price !== null && $product->price > 0 && (float) $product->front_sale_price < (float) $product->price; $salePercent = $isOnSale ? (int) round((1 - ((float) $product->front_sale_price / (float) $product->price)) * 100) : 0; $productWrapperClass = trim((string) ($productWrapperClass ?? '')); // Per-context decoration toggles (defaults preserve existing behavior). $showActions = $showActions ?? true; $showBadges = $showBadges ?? true; $showMarquee = $showMarquee ?? true; @endphp
{{ $product->name }} @if ($hoverImage) {{ $product->name }} @endif @if ($showActions) @include(EcommerceHelper::viewPath('includes.product.style-1.actions'), [ 'product' => $product, 'showQuickView' => $showQuickView, 'showQuickShop' => $showQuickShop, ]) @endif @if ($showBadges) @include(EcommerceHelper::viewPath('includes.product.badges'), ['product' => $product]) @endif @if ($showMarquee && $isOnSale && $salePercent > 0)
@for ($m = 1; $m <= 5; $m++)
{{ __('HOT SALE :percent% OFF', ['percent' => $salePercent]) }}
@endfor
@endif @if ($showQuickShop && EcommerceHelper::isCartEnabled()) @php($hasVariationsForQuickAdd = (bool) $product->hasVariations)
{{ $hasVariationsForQuickAdd ? __('Select options') : __('Add to cart') }}
@endif
@include(Theme::getThemeNamespace('views.ecommerce.includes.product.store-name'), ['product' => $product]) {{ $product->name }} @include(EcommerceHelper::viewPath('includes.product.style-1.rating'), ['product' => $product]) @include(EcommerceHelper::viewPath('includes.product.style-1.price'), ['product' => $product]) @if ((bool) theme_option('product_card_show_color_swatches', false)) @include(Theme::getThemeNamespace('views.ecommerce.includes.product.color-swatches'), ['product' => $product]) @endif