@php $pricingRows = ($pricingRows ?? collect())->values(); if ($pricingRows->isEmpty()) { $pricingRows = collect([(object) [ 'product_variant_id' => null, 'product_unit_id' => null, 'label' => null, 'mrp' => null, 'discount_type' => null, 'discount_value' => null, 'selling_price' => null, 'shipping_cost' => null, 'is_default' => 1, 'status' => 1, 'in_stock_qty' => null, 'is_in_stock' => 1, 'sort_order' => 0, ]]); } $hasDefaultPricing = $pricingRows->contains(fn($pricing) => ($pricing->is_default ?? 0) == 1); @endphp
| Default | Variant | Unit | Label | MRP * | Selling Price * | Discount (%) | @foreach (\App\Models\ProductPricing::BENEFIT_LABELS as $benefitLabel){{ $benefitLabel }} | @endforeachShipping Cost | Stock Qty | In Stock | Status | Action | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| is_default ?? 0) == 1 || (!$hasDefaultPricing && $index === 0))> | @foreach (array_keys(\App\Models\ProductPricing::BENEFIT_LABELS) as $benefitField) | @include('backend.product.partials.pricing-benefit-input', [ 'field' => $benefitField, 'prefix' => "product_pricing[{$index}]", ]) | @endforeach