Clear Cart Button

english 4235
This post adds the “Empty Shopping Cart” button to the shopping cart, which allows you to remove all items from the shopping cart straight away.

Find in: cataog/includes/application_top.php

// include the who's online functions

add before

      case 'clear_cart' :     $cart->reset(true);

Or in FROSEN Version:

    switch ($_GET['action']) {

// BOL Clear shopping_cart total
      case 'clear_cart' :     
// EOL Clear shopping_cart total

Find in: catalog/shopping_cart.php

  <div class="buttonSet">
    <div class="text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'fa fa-angle-right', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary', NULL, 'btn-success'); ?></div>

Note the

tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary', NULL, 'btn-success');

section, there are versions that are hardcoded and do not support the file variables.

These must be done by directly buying the file

tep_href_link('checkout_shipping.php', '', 'SSL'), 'primary', NULL, 'btn-success');

Change to:

  <div class="buttonSet row">
    <div class="col-xs-6"><?php echo tep_draw_button(IMAGE_BUTTON_CLEAR_CART, 'fa fa-trash', tep_href_link(FILENAME_SHOPPING_CART, 'action=clear_cart', 'NOSSL'), 'secondary', array('params' => 'onclick="return confirm('' . CLEAR_CART . '');"')); ?></div>
    <div class="col-xs-6 text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'fa fa-angle-right', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary', NULL, 'btn-success'); ?></div>

Add in the language file: catalog/includes/languages/english.php

define('IMAGE_BUTTON_CLEAR_CART', 'Clear Cart');
define('CLEAR_CART',' To empty stand of purchases? ');
Why your email address?
If necessary, I will contact you to help you with the implementation.
Your email address will not be made public.
Is this post helpful to you?
There are currently no product reviews.
General information
 Free advertising
Post counter
Current information status:
Categories: 9
Posts: 104
Support pages: 55
Downloads for members: 104
Download counter: 646
Reviews total61
Companies: 26
Support: 28
Information: 7