This PHP code enables you to increase sales by displaying a notice on the cart page when a customer adds a product to the cart offering a free product for every product purchased.
![](https://wpsites.net/wp-content/uploads/2023/10/buy-1-502x300.png)
![](https://wpsites.net/wp-content/uploads/2023/10/get-1-free-502x300.png)
A notice “Add 1 more to get the 2nd item free” is displayed to encourage customers to increase the quantity by a factor of 2.
Installation
Copy and paste the PHP code to the end of your child themes functions.php file or custom functionality plugin.
In the code, replace the product i.d on line 14 to target your buy 1 get 1 free product.
Reviews
There are no reviews yet.