доставка в плавающем
This commit is contained in:
@@ -38,10 +38,10 @@ if (!function_exists('category_tree_has_current')) {
|
||||
<a href="/catalog"><span>Весь каталог</span></a>
|
||||
</li>
|
||||
<li class="category-special-link">
|
||||
<a href="/#home-promos"><span>Акции</span></a>
|
||||
<a href="/promo"><span>Акции</span></a>
|
||||
</li>
|
||||
<li class="category-special-link">
|
||||
<a href="/#home-new"><span>Новинки</span></a>
|
||||
<a href="/new"><span>Новинки</span></a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php foreach ($items as $category): ?>
|
||||
|
||||
@@ -32,8 +32,8 @@ if (!function_exists('render_mega_category_children')) {
|
||||
<nav class="category-mega-bar" aria-label="Категории товаров">
|
||||
<div class="category-mega-inner">
|
||||
<a class="mega-root mega-all-link" href="/catalog">Весь каталог</a>
|
||||
<a class="mega-root mega-virtual-link is-promo" href="/#home-promos">Акции</a>
|
||||
<a class="mega-root mega-virtual-link is-new" href="/#home-new">Новинки</a>
|
||||
<a class="mega-root mega-virtual-link is-promo" href="/promo">Акции</a>
|
||||
<a class="mega-root mega-virtual-link is-new" href="/new">Новинки</a>
|
||||
<?php foreach ($megaCategories as $category): ?>
|
||||
<?php
|
||||
$hiddenTopCategorySlugs = ['myasnaya-gastronomiya', 'molochnaya-produkciya'];
|
||||
|
||||
@@ -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