/
var
/
www
/
vhosts
/
ihelp.ro
/
httpdocs
/
templates
/
Carts
/
/var/www/vhosts/ihelp.ro/httpdocs/templates/Carts
mkdir
upload
Name
Size
Mode
Actions
add.php
867
0644
edit
dl
rm
edit.php
1124
0644
edit
dl
rm
index.php
2481
0644
edit
dl
rm
view.bkp.php
6011
0644
edit
dl
rm
view.php
9258
0644
edit
dl
rm
Edit:
/var/www/vhosts/ihelp.ro/httpdocs/templates/Carts/view.php
(9258B)
<div class="container"> <div class="block__heading my-4"> <h1><?php echo __('Coșul meu'); ?></h1> </div> <?php if (!empty($cartItems)) : ?> <div class="row"> <div class="col-lg-8"> <div class="card-light"> <div class="block__cart"> <?php foreach ($cartItems as $cartItem) : ?> <div class="snippet rounded bg-white"> <div class="content"> <div class="image"> <figure> <?php echo $this->Html->image($this->Custom->generateUrlHdy( [ 'model_name' => $cartItem->product->model_name, 'uuid' => $cartItem->product->uuid, 'image_name' => $cartItem->product->featured_image['image_path'] ], true, 150, 100, true ), ['class' => 'img-fluid']) ?> </figure> </div> <div class="description"> <div class="title"><?php echo $cartItem->product->name; ?></div> <div class="icons mt-3"> <!-- <div class="icon"><i class="ion-ios-star mr-2"></i><?php echo __('Acumulezi 3 puncte'); ?></div> --> <div class="icon"><i class="ion-ios-cube mr-2"></i><?php echo __('Livrarea gratuită cu CheamaCurier.ro'); ?></div> <div class="icon"><i class="ion-ios-refresh mr-2"></i><?php echo __('Primești banii înapoi dacă nu ești mulțumit'); ?></div> </div> </div> <div class="quantity"> <?php if ($cartItem->product->stock > 1) : ?> <select name="qnt" class="qntCartProduct" id="<?php echo $cartItem->id; ?>"> <?php for ($q = 1; $q <= $cartItem->product->stock; $q++) : ?> <option value="<?php echo $q; ?>" <?php echo ($cartItem->qnt == $q) ? 'selected' : ''; ?>><?php echo $q; ?></option> <?php endfor; ?> </select> <?php else : ?> <?php echo h($cartItem->qnt); ?> <?php endif; ?> </div> <div class="price"> <div class="price-new"> <?php $priceProduct = (!empty($cartItem->custom_price)) ? $cartItem->custom_price : $cartItem->product->price; echo __('{0}', $this->Number->format($priceProduct * $cartItem->qnt, ['precision' => 0, 'after' => ' Lei'])); ?> </div> <div class="delete mt-3"> <?php echo $this->Form->postLink('<i class="ion-ios-trash mr-2"></i>' . __('Șterge'), ['controller' => 'Carts', 'action' => 'delete', $cartItem->id], ['confirm' => __('Are you sure you want to delete # {0}?', $cartItem->product->name), 'escape' => false]); ?> </div> </div> </div> <div class="cause"> </div> </div> <?php endforeach; ?> </div> </div> </div> <div class="col-lg-4"> <div class="card-light"> <div class="rounded bg-white p-3"> <div class="block__heading dashed"> <h3><?php echo __('Sumar comanda'); ?></h3> </div> <div class="block__cart summary"> <div class="subtotal mt-2"> <div class="row"> <div class="col-lg-8"> <?php echo __('Subtotal') ?>: </div> <div class="col-lg-4 text-right"> <?php echo $this->Number->format($totalPriceCart, ['precision' => 0, 'after' => ' Lei']); ?> </div> </div> </div> <div class="subtotal mt-2"> <div class="row"> <div class="col-lg-8"> <?php echo __('Cost livrare și procesare') ?>: </div> <div class="col-lg-4 text-right"> <span class="text-primary font-weight"><?php echo __('Gratuit') ?></span> </div> </div> </div> <div class="total mt-2 py-3"> <div class="text"><?php echo __('Total') ?></div> <div class="amount"> <?php echo $this->Number->format($totalPriceCart, ['precision' => 0, 'after' => ' Lei']); ?></div> </div> <div class="call-to-action"> <?php echo $this->Html->link(__('Continua'), ['controller' => 'Orders', 'action' => 'checkout'], ['class' => 'btn full primary size-lg']); ?> </div> </div> </div> </div> </div> <?php else : ?> <div class="alert alert-danger"><?php echo __('Nu există niciun produs în coș.') ?></div> <?php endif ?> </div> <?php $this->append('script'); ?> <script> $(document).ready(function() { $('.qntCartProduct').change(function() { var itemId = $(this).attr('id') var newQnt = $(this).val() $.ajax({ url: "<?php echo $this->Url->build(['controller' => 'Carts', 'action' => 'edit'], ['fullBase' => true]) ?>", type: 'post', dataType: "json", data: { 'id': itemId, 'qnt': newQnt }, beforeSend: function(xhr) { xhr.setRequestHeader('X-CSRF-Token', $('meta[name="_csrfToken"]').attr('content')); }, success: function(response) { if (!response.error && !response.forceRedir) { Swal.fire({ position: 'center', icon: 'success', title: 'Cosul de cumparaturi a fost actualizat', showConfirmButton: false, timerProgressBar: true, timer: 22200, onClose: () => { location.reload(); } }) } else { Swal.fire({ position: 'center', icon: 'error', title: response.msg, showConfirmButton: true, timerProgressBar: true, timer: 22200, onClose: () => { location.reload(); } }) } } }); }) }) </script> <?php $this->end(); ?>
Save
cmd:
run