product custom fields

This commit is contained in:
elvira
2026-09-23 17:53:23 +03:00
parent a4240b6474
commit 580adac33a
24 changed files with 670 additions and 12 deletions
+10 -4
View File
@@ -166,7 +166,7 @@ class="absolute bottom-6 right-8 text-white text-sm"
@endif
@php
$desc = strip_tags($product['description'] ?? '');
$desc = html_entity_decode(strip_tags($product['description'] ?? ''), ENT_QUOTES | ENT_HTML5, 'UTF-8');
$descTruncated = Str::limit($desc, 137);
$descNeedsMore = mb_strlen($desc) > mb_strlen(rtrim($descTruncated, '.'));
@endphp
@@ -195,10 +195,16 @@ class="underline-slide font-semibold whitespace-nowrap"
<x-checkout::add-to-cart
:purchasable="$variantsData[0]['id'] ?? null"
:quantity="false"
class="flex items-stretch gap-10"
class="flex flex-col gap-6"
>
<x-ui.quantity name="quantity" />
<x-ui.button type="submit" class="flex-1">{{ __('storefront.product.add_to_cart') }}</x-ui.button>
@if(!empty($product['custom_fields']))
<x-product-custom-fields :fields="$product['custom_fields']" />
@endif
<div class="flex items-stretch gap-10">
<x-ui.quantity name="quantity" />
<x-ui.button type="submit" class="flex-1">{{ __('storefront.product.add_to_cart') }}</x-ui.button>
</div>
</x-checkout::add-to-cart>
{{-- Storefront-owned, not part of the checkout module — the