X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Clear cart if cusotmer logs out (https://forum.x-cart.com/showthread.php?t=20743)

mmoskva 03-27-2006 05:23 AM

Clear cart if cusotmer logs out
 
If a customer adds an items to their cart and then logs out; when they log back in I am re-directed to the cart page.

- If a cusotmer logs out, how can I clear the cart history, so the item is not saved into their basket. The cusotmer would have to re-add the item to their cart?

balinor 03-27-2006 05:25 AM

You would need to clear their cookie on logout. Why would you not want your customers to save their cart? Personlly I'd be annoyed to come back and find my cart empty as I often save a cart for future purchase.

mmoskva 03-27-2006 05:30 AM

How would I clear go about in clearing the cookies?

ipointadam 08-30-2013 07:43 AM

Re: Clear cart if cusotmer logs out
 
I really need the cart to empty due to QTY control. I need items to drop from users carts upon logout. Is this possible?

cflsystems 08-30-2013 08:55 AM

Re: Clear cart if cusotmer logs out
 
It has to be custom coded to do that. But items in cart for one custom do not affect quantity for others - only after order is placed

ipointadam 08-30-2013 10:09 AM

Re: Clear cart if cusotmer logs out
 
Quote:

Originally Posted by cflsystems
It has to be custom coded to do that. But items in cart for one custom do not affect quantity for others - only after order is placed


The way my system works is it immediately makes the QTY change. The client is complicated. Though for anyone else looking for the solution, this is what I did...

Open {XCART DIRECTORY}/includes/login.php

find
Code:

if ($mode == 'logout') {

add this right after it
Code:

db_query("UPDATE $sql_tbl[customers] SET cart='' WHERE username='$username'");


All times are GMT -8. The time now is 09:13 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.