Files
2025-12-24 19:19:01 +03:00

71 lines
3.5 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
global $cart;
$products = $cart->get_product_items();
$cart_info = $cart->cart_total_price();
$count = $cart->get_count();
$has_coupon = false;
$coupon_id = $b->session_get("coupon_id");
if($coupon_id) {
$coupon = $b->get_item_by_id($coupon_id);
if($coupon) $has_coupon = true;
}
?>
<section class="section first-other cart">
<div class="container-small">
<h1>Корзина</h1>
<div class="variants__products cart__list cart-list">
<?php foreach ($products as $key => $product) { ?>
<?php $b->template_load("productCart/product_row.php", array("product" => $product["item"], "count" => $product["count"])); ?>
<?php } ?>
</div>
<div class="cart-list__params promo row align-items-center">
<h3 class="promo__heading col-auto" id="promocode-label">Есть промо-код?</h3>
<div class="promo__form">
<form action="" class="row">
<?php if($has_coupon === false) { ?>
<input type="text" class="input-form" placeholder="Текст" id="promocode-text"/>
<button class="form-btn" type="submit" id="promocode-btn-apply">ok</button>
<?php } else { ?>
<input type="text" class="input-form" placeholder="Текст" id="promocode-text" readonly value="<?= $b->get_view($coupon->get_item_name()); ?>"/>
<button class="form-btn" type="submit" id="promocode-btn-delete">удалить</button>
<?php }?>
</form>
</div>
</div>
<div class="cart-list__zakaz form-zakaz">
<h3 class="promo__heading promo__heading_zakaz">Ваш заказ (<?= $count; ?>)</h3>
<div class="form-zakaz__box row align-items-end justify-content-between">
<p class="col-auto">Товаров на</p>
<span class="col"></span>
<p class="price col-auto"><?= number_format($cart_info["regular_sum"], 2, ',', ' '); ?> ₽</p>
</div>
<div class="form-zakaz__box row align-items-end justify-content-between">
<p class="col-auto">Скидка</p>
<span class="col"></span>
<p class="price col-auto"><?= number_format($cart_info["sale_sum"], 2, ',', ' '); ?> ₽</p>
</div>
<div class="form-zakaz__box form-zakaz__box_total row align-items-end justify-content-between">
<p class="col-auto">ИТОГО</p>
<span class="col"></span>
<p class="price col-auto"><?= number_format($cart_info["final_sum"], 2, ',', ' '); ?> ₽</p>
</div>
<?php if($count != 0) { ?>
<a class="form-zakaz__btn" href="/checkout/">оформить заказ</a>
<label class="agreement">
<input type="checkbox" class="agreement-checkbox" checked required>
<span>
<span>
Я согласен с условиями предоставления услуг и
<a href="/page/privacy/">обработкой моих персональных данных</a> при
нажатии "Оставить заявку"
</span>
</span>
</label>
<?php } ?>
</div>
</div>
</section>