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>
|
||||
39
playarea/templates/productCart/one_click.php
Normal file
39
playarea/templates/productCart/one_click.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php $product = $variables["product"]; ?>
|
||||
<div class="popup__product-item">
|
||||
<div class="popup__product-img">
|
||||
<img src="<?= $product->get_prop_render_value("product_photo"); ?>" alt="" />
|
||||
</div>
|
||||
<a href="/product/<?= $product->get_item_slug(); ?>/" class="popup__product-name"><?= $product->get_item_name(); ?></a>
|
||||
<div class="popup__product-bot">
|
||||
<div data-quantity="" class="popup__product-quantity quantity">
|
||||
<button type="button" class="quantity__button quantity__button_minus calc__btn minus" data-price="<?= $product->get_price(); ?>"></button>
|
||||
<div class="quantity__input">
|
||||
<input readonly="" autocomplete="off" type="number" title="Qty" min="1" max="1000" step="1" value="1"/>
|
||||
</div>
|
||||
<button type="button" class="quantity__button quantity__button_plus calc__btn plus" data-price="<?= $product->get_price(); ?>"></button>
|
||||
</div>
|
||||
<div class="popup__product-price"><span><?php $this->template_load("product/short_price.php", array("price" => $product->get_prop("price"), "sale_percent" => $product->get_prop("sale_percent"))); ?></span>₽</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="popup__form">
|
||||
<form action="" class="popup-appeal">
|
||||
<input type="hidden" name="url" value="<?= $b->get_view($_SERVER["REQUEST_URI"]); ?>">
|
||||
<input type="hidden" name="title" value="Купить в один клик">
|
||||
<input type="hidden" name="message" value="Количество товаров: 1">
|
||||
<input type="text" class="input-form" placeholder="Ваше имя" name="name" required />
|
||||
<input type="tel" class="input-form phone-input" placeholder="Ваш телефон" name="phone" required data-inputmask="'mask': '+7 (999) 999-9999'" />
|
||||
<button type="submit" class="form-btn popup-appeal__button">Отправить</button>
|
||||
<label class="agreement">
|
||||
<input type="checkbox" class="agreement-checkbox" checked required>
|
||||
<span>
|
||||
<span>
|
||||
Я согласен с условиями предоставления услуг и
|
||||
<a href="/page/privacy/">обработкой моих персональных данных</a> при
|
||||
нажатии "Оставить заявку"
|
||||
</span>
|
||||
</span>
|
||||
</label>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
14
playarea/templates/productCart/price.php
Normal file
14
playarea/templates/productCart/price.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php $count = $variables["count"]; ?>
|
||||
<?php $count_price = ($variables["price"] * $count ); ?>
|
||||
<?php $product_price = number_format($count_price, 2, ',', ' '); ?>
|
||||
<?php if($variables["sale_percent"] > 0) { ?>
|
||||
<?php $product_sale_price = number_format($count_price * (1 - ($variables["sale_percent"] / 100)), 2, ',', ' '); ?>
|
||||
<p class="product-wrapper__oldprice"><del><?= $product_price; ?> ₽</del></p>
|
||||
<p class="product-wrapper__newprice"><?= $product_sale_price; ?> ₽</p>
|
||||
<?php } else { ?>
|
||||
<?php if($variables["price"] > 0) { ?>
|
||||
<p class="product-wrapper__newprice"><?= $product_price; ?> ₽</p>
|
||||
<?php } else { ?>
|
||||
<p class="product-wrapper__newprice">по запросу</p>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
39
playarea/templates/productCart/product_row.php
Normal file
39
playarea/templates/productCart/product_row.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
$product = $variables["product"];
|
||||
$cart_count = $variables["count"];
|
||||
$in_storage = $product->get_prop("product_in_stock");
|
||||
|
||||
?>
|
||||
<div class="cart-list__item cart-item row align-items-center justify-content-between">
|
||||
<div class="first row align-items-center">
|
||||
<figure class="product__image">
|
||||
<img src="<?= $product->get_prop_render_value("product_photo") ?>" alt="" />
|
||||
</figure>
|
||||
<div class="cart-item__params">
|
||||
<a class="product__title" href="/product/<?= $product->get_item_slug(); ?>/"><?= $product->get_item_name(); ?></a>
|
||||
<?php if($in_storage) { ?>
|
||||
<!-- <p class="product__qty">На складе --><?php //= $in_storage; ?><!-- шт</p>-->
|
||||
<p class="product__qty">В наличии</p>
|
||||
<?php } else { ?>
|
||||
<p class="product__qty">В наличии</p>
|
||||
<!-- <p class="product__qty">Нет на складе</p>-->
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="second quantity">
|
||||
<button type="button" class="quantity__button quantity__button_minus calc__btn minus" product_id="<?= $product->item_id; ?>"></button>
|
||||
<div class="quantity__input">
|
||||
<input readonly="" autocomplete="off" type="number" title="Qty" min="1" max="1000" step="1" value="<?= $cart_count; ?>"/>
|
||||
</div>
|
||||
<button type="button" class="quantity__button quantity__button_plus calc__btn plus" product_id="<?= $product->item_id; ?>"></button>
|
||||
</div>
|
||||
<span class="third product-wrapper__prices col-auto">
|
||||
<?php $this->template_load("productCart/price.php", array("price" => $product->get_prop("price"), "sale_percent" => $product->get_prop("sale_percent"), "count" => $cart_count)); ?>
|
||||
</span>
|
||||
<button class="close product-cart-remove" product_id="<?= $product->item_id; ?>">
|
||||
<svg class="search-button__find">
|
||||
<use xlink:href="<?= $b->pa_get_assets_dir() ?>main/images/icons/sprite.svg#close"></use>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
Reference in New Issue
Block a user