In Woocommerce, I Would like co create add to cart link on a simple page of WordPress website (not product page).
So I have tried this code (Where 123 is the product ID):
<a href="http://example.com/cart/?add-to-cart=123">Buy</a>
I have enabled AJAX add to cart on archives pages Woocommerce option setting.
But It doesn't work and Ajax functionality is not enabled on my custom Add-to-cart link.
How to enable ajax add-to-cart on a custom link (in other pages than woocommerce ones)?
http://example.com/cart/?add-to-cart=123
usehttp://example.com/{your-current-page}/?add-to-cart=123
– Samvel Aleqsanyan