iCubik Posted June 19, 2018 Share Posted June 19, 2018 Hi, We recently made our own WHMCS theme which can be seen here, https://client.cubiknode.com the problem is when you add a item to your cart, you can't press the 'x' to remove it from your cart if you no longer want it. My question to you, is how do we fix that? 0 Quote Link to comment Share on other sites More sharing options...
TomoTech Posted June 28, 2018 Share Posted June 28, 2018 We had the same problem when making our custom theme, To fix we used the below method (not sure where we actually got this from) Create a hook file called clearcart.php Add in the below: <?php if ($_REQUEST["cc"] == "1") { unset($_SESSION["cart"]); } The above would allow you to add a <a href="" or onclick="" to the cart template clear cart button making it so when clicked it reloads the page sets the variable CC as 1 clearing the cart. e.g https://mysite.com/whmcs/cart.php?a=view&cc=1 this would clear the cart if the above code was in a hook. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 29, 2018 Share Posted June 29, 2018 17 hours ago, TomoTech said: Create a hook file called clearcart.php but he's not looking to clear/empty the cart, only to get the js code that removes one item working again! On 6/19/2018 at 17:58, iCubik said: We recently made our own WHMCS theme which can be seen here, https://client.cubiknode.com the problem is when you add a item to your cart, you can't press the 'x' to remove it from your cart if you no longer want it. have you modified /templates/orderforms/standard_cart/js/scripts.min.js in any way ? because that's where the function is defined... if not, i'm wondering if you have a jQuery clash with the jQuery link in the header (https://cubiknode.com/assets/js/jquery-2.1.3.min.js), or any of the dozen+ .js links in the footer. if you haven't modified any of the core WHMCS .js files, then i'd disable all those non-WHMCS .js files, and working through them (enabling one by one) to see which is affecting the removeitem function in the cart. I did notice that when you change the system template to "Six", the remove button semi-works, in that it at least creates the popup window, but it's greyed out... so there is likely a .js clash somewhere. 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.