I wish to completely remove any redirection after a user click on the ADD TO CART button.
Actually I am not using the products page.
I am using a simple button with the link to the product, like this: ?add-to-cart=492
.
My user will click on several "add to cart" buttons on my page, so he cant be redirected to any page after clicking in the first button.
At the end of the page he will find a CHECKOUT button to pay and that is it.
Any ideas how to achieve this?
Thanks
Update:
Your simple html "add-to-cart" button links are actually for example like that (the
href
value):2 SOLUTIONS:
1) Use the WooCommerce short code [add-to-cart] this way:**
[add_to_cart id="492" show_price="false"]
[add_to_cart id="492"]
2) Html code in your page text editor - To prevent redirections, the
href
attribute should be:THE CHECKOUT BUTTON
To finish, here is a custom shortcode that will output the "Proceed to checkout" button:
Code goes in function.php file of your active child theme (or theme) or also in any plugin file.
Original answer:
First, In WooCommerce settings you need to:
Then you can add a custom "Proceed to checkout" button using:
Code goes in function.php file of your active child theme (or theme) or also in any plugin file.
The button "Proceed to checkout" will be show at the bottom of this pages.
If you want to skip the cart page:
Code goes in function.php file of your active child theme (or theme) or also in any plugin file.
All code is tested and works.