Jump to content

Empty cart when users click on direct shopping cart link


ditto

Recommended Posts

Is there anything I can add to the direct shopping cart link to empty the cart when a user click on the direct shopping cart link?

 

At the moment I have WHMCS installed on a subdomain, and on my main domain I use direct shopping cart links pointing directly to my products on the cart.php at the subdomain.

 

The problem is that often users look around in the shopping cart and add test domains, and then leave, but when they come back to my site after a short period of time, and then click on the direct shopping cart link again, the old domain names is still in the cart, and then they get confused.

 

This is a example of one of the direct shopping cart links that I am using:

 

https://sub.domain.com/cart.php?a=add&pid=1

 

Is there anything I can add to the URL to empty the cart when you click on the link?

Link to comment
Share on other sites

Actually that doesn't work unless the product has a domain.

 

Try this instead...

 

Create a file clearcart.php in /includes/hooks/

 

File contents:

 

<?php

if ($_REQUEST["cc"] == "1") {

unset($_SESSION["cart"]);

}

?>

 

Then modify the URLs as before.

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
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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated