Initial commit
This commit is contained in:
71
playarea/templates/productCart/block.php
Normal file
71
playarea/templates/productCart/block.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?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>
|
||||
Reference in New Issue
Block a user