шаг 4 завершен
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?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>
|
||||
Reference in New Issue
Block a user