36 lines
1.4 KiB
PHP
36 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/** @var array<string, mixed> $product */
|
|
?>
|
|
<article class="product-card">
|
|
<p class="product-category"><?= e($product['category_name'] ?? 'Каталог') ?></p>
|
|
<h3><a href="/product/<?= e($product['slug']) ?>"><?= e($product['name']) ?></a></h3>
|
|
<p><?= e($product['variant_name'] ?? 'Выберите доступную фасовку') ?></p>
|
|
|
|
<?php if ($product['price_per_unit'] !== null): ?>
|
|
<span class="price-line">за <?= e($product['unit'] ?? 'ед.') ?>: <?= e((string) $product['price_per_unit']) ?> руб.</span>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($product['package_price'] !== null): ?>
|
|
<strong>
|
|
<?php if (!empty($product['old_package_price'])): ?>
|
|
<span class="old-price"><?= e((string) $product['old_package_price']) ?> руб.</span>
|
|
<?php endif; ?>
|
|
<?= e((string) $product['package_price']) ?> руб. за фасовку
|
|
</strong>
|
|
<?php endif; ?>
|
|
|
|
<?php if (!empty($product['price_tiers'])): ?>
|
|
<ul class="price-tiers">
|
|
<?php foreach ($product['price_tiers'] as $tier): ?>
|
|
<li>
|
|
<span><?= e($tier['label']) ?></span>
|
|
<strong><?= e((string) $tier['price']) ?> руб.</strong>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
<?php endif; ?>
|
|
</article>
|