ditto Posted February 26, 2010 Share Posted February 26, 2010 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? 0 Quote Link to comment Share on other sites More sharing options...
Pete_RH Posted February 26, 2010 Share Posted February 26, 2010 Try this... Drop this into the top of header.tpl (front-end) {php} if ($_REQUEST["cc"] == "1") { unset($_SESSION["cart"]); } {/php} Then add &cc=1 t to the end of your product URLs e.g. http://.../cart.php?a=add&pid=1&cc=1 Regards -- Peter 0 Quote Link to comment Share on other sites More sharing options...
Pete_RH Posted February 26, 2010 Share Posted February 26, 2010 Actually that doesn't work unless the product has a domain. Try this instead... Create a file clearcart.php in /includes/hooks/ File contents: <?phpif ($_REQUEST["cc"] == "1") { unset($_SESSION["cart"]); } ?> Then modify the URLs as before. 0 Quote Link to comment Share on other sites More sharing options...
ditto Posted February 27, 2010 Author Share Posted February 27, 2010 Thank you very much, Peter! I have tested it thorough, and it works perfectly! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.