Posted: February 6, 2014 at 2:43 am
do_shortcode I take it that no “echo” is needed infront since is a action and not a output? Page with shortcode Adding a link to press which clears the cart Its important to note that im refering to a AJAX look-a-like functionality. Im not interested in a page reload or a page-redirect, i can do that with the upper two. The empty cart link have to function the same was as “add to cart”. A spinnin wheel (gif file i presume) will apear and the functionality will be executed. The top 2 solutions is not a issue, im just showing what i already know. The one im missing is bottom solution with the HTML link. Is that possible?
| |
Hi, There isn’t an inbuilt way to clear the cart in one go, barring heading over to the [ESPRESSO_CANCELLED] page, which basics launches a PHP function to clear the session. You could perhaps modify the jQuery that deals with deleting a single event from the cart and create a new function to clear all and attach that to a button | |
Hello Dean :-) Ok i see. I take it that it would be totally possible for me to write a new function called __ex_clear_cart(); and make that function clear the cart session array? Do you see any problem with that? | |
I don’t see any issues, so long as you load the jQuery in correctly. I would advise using the custom_functions.php or a custom plugin to load the jQuery. Of course you will need to edit the cart template as well to insert a button (unless the button is in the sidebar etc). | |
Yea i already have a custom_functions.php :-) Ok Dean, thanks for the help. | |
The support post ‘Ways to empty the cart’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.