How to automatically add product to cart on visit in WooCommerce?

Posted by Prem Tiwari | Updated on

For automatically adding product to cart on visit in WooCommercee can be achieved by by adding the below code at the end of your theme’s functions.php file or you can also add the below code inside your site-specific plugin.

If you want to automatically add a product to the cart depending on the cart total use the following code:

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

Related Questions & Answers