Posted on 22/07/2009 09:44:46
jl@rc-media.dk wrote:
If you need to empty the cart on certain pages, you can use the CartCommand 'emptycart' (by calling an url with the parameter cartcmd=emptycart). You can do this by javascript.
Hello,
I have the same problem! I have also tried to set the cart to 0 and 1 day. How can I call Cartcmd=emptycart with javascript?
Thanks
There are a few ways of doing it, but the easiest would probably be to set the 'location.href' property. The code would look something like this:
<script type="text/javascript" language="javascript">
location.href = location.href + "&cartcmd=emptycart";
</script>
You would also need to check for whether you already did the redirect so you don't get infinite redirects.