@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
Pricing Info
Drag the handle to reorder rows — the app shows sizes/quantities in this order. Cashback Points, E-Coin, eCoin Redeem and CRC apply per row. Leave a box blank to use the product setting below; enter 0 for none.
@foreach (\App\Models\ProductPricing::BENEFIT_LABELS as $benefitLabel) @endforeach @foreach ($pricingRows as $index => $pricing) @foreach (array_keys(\App\Models\ProductPricing::BENEFIT_LABELS) as $benefitField) @endforeach @endforeach
Default Variant Unit Label MRP * Selling Price * Discount (%){{ $benefitLabel }}Shipping Cost Stock Qty In Stock Status Action
is_default ?? 0) == 1 || (!$hasDefaultPricing && $index === 0))> @include('backend.product.partials.pricing-benefit-input', [ 'field' => $benefitField, 'prefix' => "product_pricing[{$index}]", ])