доставка в плавающем
This commit is contained in:
@@ -60,6 +60,10 @@ $activeTierUnit = $activeShowsUnitPrice ? unit_label((string) ($activeVariant['u
|
||||
$isPublished = (int) ($product['is_published'] ?? 1) === 1;
|
||||
$isAvailable = (int) ($product['is_available'] ?? 1) === 1;
|
||||
$isPurchasable = $isPublished && $isAvailable && $activePackagePrice > 0;
|
||||
$sourceImagePath = (string) ($product['main_image_path'] ?? '');
|
||||
$previewImagePath = function_exists('optimized_image_path')
|
||||
? optimized_image_path($sourceImagePath, 'preview')
|
||||
: $sourceImagePath;
|
||||
?>
|
||||
<article
|
||||
class="product-card price-aware<?= $isPurchasable ? '' : ' is-unavailable' ?>"
|
||||
@@ -67,7 +71,7 @@ $isPurchasable = $isPublished && $isAvailable && $activePackagePrice > 0;
|
||||
data-product-id="<?= e((string) ($product['id'] ?? '')) ?>"
|
||||
data-product-name="<?= e((string) ($product['name'] ?? '')) ?>"
|
||||
data-product-slug="<?= e((string) ($product['slug'] ?? '')) ?>"
|
||||
data-product-image="<?= e((string) ($product['main_image_path'] ?? '')) ?>"
|
||||
data-product-image="<?= e($previewImagePath) ?>"
|
||||
data-show-unit-price="<?= $activeShowsUnitPrice ? '1' : '0' ?>"
|
||||
>
|
||||
<?php if (!$isPurchasable): ?>
|
||||
@@ -77,13 +81,13 @@ $isPurchasable = $isPublished && $isAvailable && $activePackagePrice > 0;
|
||||
<span class="product-card-badge is-<?= e((string) ($product['badge_kind'] ?? 'default')) ?>"><?= e((string) $product['badge_label']) ?></span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($product['main_image_path']) && $isPurchasable): ?>
|
||||
<?php if ($previewImagePath !== '' && $isPurchasable): ?>
|
||||
<a class="product-card-image" href="/product/<?= e($product['slug']) ?>" aria-label="<?= e($product['name']) ?>">
|
||||
<img src="<?= e((string) $product['main_image_path']) ?>" alt="<?= e((string) $product['name']) ?>" loading="lazy" decoding="async">
|
||||
<img src="<?= e($previewImagePath) ?>" alt="<?= e((string) $product['name']) ?>" loading="lazy" decoding="async">
|
||||
</a>
|
||||
<?php elseif (!empty($product['main_image_path'])): ?>
|
||||
<?php elseif ($previewImagePath !== ''): ?>
|
||||
<div class="product-card-image" aria-label="<?= e($product['name']) ?>">
|
||||
<img src="<?= e((string) $product['main_image_path']) ?>" alt="<?= e((string) $product['name']) ?>" loading="lazy" decoding="async">
|
||||
<img src="<?= e($previewImagePath) ?>" alt="<?= e((string) $product['name']) ?>" loading="lazy" decoding="async">
|
||||
</div>
|
||||
<?php elseif ($isPurchasable): ?>
|
||||
<a class="product-card-image product-card-image-placeholder" href="/product/<?= e($product['slug']) ?>" aria-label="<?= e($product['name']) ?>">
|
||||
|
||||
Reference in New Issue
Block a user