Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Remove all items from cart with one click


veszka

Recommended Posts

Hi all,

 

I would like to add a new button to shopping_cart.php, which delete all products from my basket (shopping cart) with one click. I searched in the topics, but didn't find any solution for this feature.

 

Can anybody help me?

 

Kind regards,

Tamas

Link to comment
Share on other sites

Amend /includes/application_top.php

 

 

switch ($HTTP_GET_VARS['action']) {

case 'clear_cart':

$cart->remove_all();

tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));

break;

 

 

add a new button in shopping_cart.php with an action of "clear_cart"

 

 

Thank you! Helpfull post.

Here is the code of the new button:

<span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_REMOVE_CART, 'trash', tep_href_link(FILENAME_SHOPPING_CART, tep_get_all_get_params(array('action')) . 'action=clear_cart')); ?></span>

Link to comment
Share on other sites

  • 4 weeks later...

And here is a complete tutorial on how to do this

 

 

I have one problem with this solution. If we use the function remove_all() in this case the items not delete from table customers_basket and if the customer login again, the content of basket will appear...

 

I tried to replace the function to cleanup() , but it doesn't work.

 

I'm waiting for the comments.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...