product options layout and add to cart button in homepage

This commit is contained in:
elvira
2026-09-21 18:53:45 +03:00
parent af0245de43
commit a107184010
10 changed files with 225 additions and 537 deletions
+5 -5
View File
@@ -169,13 +169,13 @@ class="absolute bottom-6 right-8 text-white text-sm"
@endif
</div>
@if($option && !empty($product['variants']))
@if($optionIsColor)
<x-ui.color-swatch :variants="$product['variants']" :option="$option" />
@foreach($productOptions as $productOption)
@if($productOption['isColor'])
<x-ui.color-swatch :values="$productOption['values']" :option="$productOption['label']" :option-handle="$productOption['handle']" />
@else
<x-ui.option-buttons :variants="$product['variants']" :option="$option" />
<x-ui.option-buttons :values="$productOption['values']" :option="$productOption['label']" :option-handle="$productOption['handle']" />
@endif
@endif
@endforeach
<x-checkout::add-to-cart
:purchasable="$variantsData[0]['id'] ?? null"