Woocommerce – Add a product to cart programmatically via JS or PHP

Posted by Prem Tiwari | Updated on

OK so here’s how I solved it in the end. A quick and dirty example, uses JQuery.

This just makes an AJAX GET request to the cart url


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers