order emails theming, sold out product card, contact page hcaptcha

This commit is contained in:
elvira
2026-09-25 17:44:42 +03:00
parent 3347febb3c
commit e2d7bbb043
21 changed files with 445 additions and 39 deletions
+5 -1
View File
@@ -19,7 +19,7 @@ final class ProductCard
{
/**
* @param array<string, mixed> $product one item from ProductService's localized array shape
* @return array{name: ?string, price: ?string, image: ?string, href: string, variantId: ?int, hasCustomFields: bool}
* @return array{name: ?string, price: ?string, image: ?string, href: string, variantId: ?int, hasCustomFields: bool, soldOut: bool}
*/
public static function fromIndexed(array $product): array
{
@@ -38,6 +38,10 @@ public static function fromIndexed(array $product): array
// can't be quick-added from a card — the card links to the
// product page instead, even when every field is optional.
'hasCustomFields' => ! empty($product['custom_fields']),
// Index-time stock (see boboko-core's ProductIndexer `in_stock`),
// so only as fresh as the last reindex. A document missing the
// field is treated as in stock rather than hiding its cart button.
'soldOut' => ! ($product['in_stock'] ?? true),
];
}
}