Hi I want to change the “add to cart” button url on my single product page so when we click it , the button will redirect to another website (amazon).
Ps. im not a coder but simple code might work for me
Hi I want to change the “add to cart” button url on my single product page so when we click it , the button will redirect to another website (amazon).
Ps. im not a coder but simple code might work for me
2
Answers
As Mentioned the description, you want to redirect to different page after the add to cart action.
So, You can put the below code in functions.php file
Thanks!!!
Woocommerce works with a hook system, you can redirect the URL of your add to cart button with a php shortcode but, you can also use the plugin: Woocommerce Add to cart custom redirect. The best way for you if you don’t know how to use php shortcode 🙂
link : https://fr.wordpress.org/plugins/woocommerce-add-to-cart-custom-redirect/