So I already have set up my WooCommerce child theme and organized the website with dummy data.
I can't find a way to change the link from the "Add to Cart" to an external link. I want it so that each time someone clicks on the "Add to Cart" button the user be taken to external link example.com
How do I go about this?
P.S: I'm not worried about any of the security aspects since the site won't be used for real money transactions.
not going to ask about the idea behind your question, but using this filter will for sure do what you need:
Woo-commerce plugin for Wordpress have custom
add-to-cart
features. You can add it fromproduct
or usingshortcode
to your script or posts.Depending on the product type you use. You can find all add_to_cart template file in the folder.
You can set your product as external product, and it will redirect user to the external page.
If you want to stay with simple or variation product, you'll need to copy/paste the file you need in your child theme and modify it.