@php // Wide "Perfect Health Combos" card. Pricing/discount/stock is derived exactly // like frontend.components.home-product-card so admin-managed data drives it, // and every class the shared cart binder in template-base.blade.php looks for // (.product-card[data-pricing-id], .cart-btn, .counter-area, .minus-btn, // .count-val, .plus-icon > .plus-line) is kept — only the layout differs. $pricingOptions = $product->pricing->values(); $pricing = $pricingOptions->first(); $mrp = (float) ($pricing?->mrp ?? 0); $sellingPrice = (float) ($pricing?->selling_price ?? $mrp); $discount = $mrp > 0 && $sellingPrice < $mrp ? (int) round((($mrp - $sellingPrice) / $mrp) * 100) : 0; $quantityLabel = $pricing?->label ?: trim(implode(' ', array_filter([ $pricing?->variant?->value, $pricing?->unit?->nickname ?: $pricing?->unit?->name, ]))); $image = \App\Helpers\Helper::get_image($product->image) ?: asset('backend/template/images/no-image.png'); $stockStatus = $pricing?->resolveStockStatus() ?? \App\Models\ProductPricing::STOCK_OUT; $isPreorderNow = $stockStatus === \App\Models\ProductPricing::STOCK_OUT; $detailUrl = route('frontend.product-details', ['product_id' => $product->id]); // 3-up on its own, 2-up when a promo panel shares the row (see v2-sections/card). $comboColClass = $comboColClass ?? 'col-lg-4 col-md-6 col-12 v2-combo-col'; @endphp