News:

Looking for documentation? Take a look on our wiki

Main Menu

Empty Cart Automatically

Started by bzh, October 04, 2012, 19:20:39 PM

Previous topic - Next topic

bzh

Does anyone know how I could setup Virtuemart to automatically empty the cart if a visitor browses away? I am trying to set up a shop where customers can only buy one item at a time; the problem is customers can click "back" and add other items to the cart. Is there any way I can clear the cart if a customer navigates away?

bytelord

Hello,

I can give a fast idea is coming to my mind. You will keep a track (session) that stores some information you want, when the users navigates to somewhere else in your preferred layouts you will load that session and if it's true for example you will empty the cart. If you needed everywhere then you should create a plugin that will empty the cart (you have to study and experience on php programming, joomla and vm plugin system).

You can see here an example with sessions i have made for the back to category button that will help you to understand the "concept"

http://forum.virtuemart.net/index.php?topic=106713.msg356430#msg356430

Also here you can see a way to empty the cart i post before some days: https://forum.virtuemart.net/index.php?topic=108211.msg361990#msg361990

https://forum.virtuemart.net/index.php?topic=108211.msg361990#msg361990

Regards

Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!