$product */ $variants = $product['preview_variants'] ?? []; $activeVariant = $variants[0] ?? [ 'name' => $product['variant_name'] ?? '', 'unit' => $product['unit'] ?? '', 'price_per_unit' => $product['price_per_unit'] ?? null, 'package_price' => $product['package_price'] ?? null, 'old_package_price' => $product['old_package_price'] ?? null, ]; $cardId = 'product-card-' . (int) ($product['id'] ?? 0); $activePackagePrice = (float) ($activeVariant['package_price'] ?? 0); $activeUnitPrice = $activeVariant['price_per_unit'] === null ? null : (float) $activeVariant['price_per_unit']; ?>
<?= e((string) $product['name']) ?>

Цена за : > За упаковку:
Фасовка:
$variant): ?>