Jump to content

Remove from cart button not working


iCubik

Recommended Posts

  • 2 weeks later...

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.

 

Link to comment
Share on other sites

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! 9_9

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.

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