How to add a promotional product when a certain cart amount is reached

Posted by Prem Tiwari | Updated on

If you want to add a promotional product when a certain cart amount is reached? As you are targeting a certain cart amount to add a promotional product in the cart, you could use woocommerce_before_calculate_totals hook to achieve this with a custom built function.

You have also to remove that promo item if customer update the cart (which is embed in that custom function too).

Here is the code:


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