@php foreach ($bundles as $key => $bundle) { if ($bundle->variations->count()) { foreach($bundle->variations as $variation) { $variantBundle[$variation->product_variation_id] = [ 'id' => $variation->product_variation_id, 'stock' => $variation->item_quantity, ]; } } else { $singleBundle[$bundle->item_product_country_id] = [ 'id' => $bundle->item_product_country_id, 'stock' => $bundle->item_quantity ]; } } @endphp
| Add to Bundle | |||
| {{$product->name}} | @foreach ($variation->combinations as $combination) {{$combination->attributeValue->attribute_value." "}} @endforeach | id]) value="{{$variantBundle[$variation->id]['stock'] ?? 1}}" @endisset> | |
| {{$product->name}} | Single | productCountry->id]) value="{{$singleBundle[$product->productCountry->id]['stock'] ?? 1}}" @endisset> |