Site icon Tutorials Website: Upgrade Your Web Development & Coding Skills

How to Add a Buy 2 Get 1 Free (BOGO) Offer in WooCommerce

WooCOmmerce: Buy 2 Get 1 Free Offer (BOGO)

Offering a Buy 2 Get 1 Free (BOGO) promotion in your WooCommerce store is an excellent way to boost sales and increase customer engagement. While WooCommerce doesn’t have a built-in feature for this, you can achieve it using custom PHP code.

Fast And Secure Hosting For WordPress

Experience lightning-fast speed, rock-solid security, and world-class support tailored for WordPress. Simply better hosting.

Why WooCommerce Doesn’t Offer BOGO

WooCommerce has a simple discount and coupon system, but it lacks advanced promotional features like BOGO. To create such discounts, you need to write custom PHP code for full control.

Suggested Read: Track and Display ‘Add to Cart’ Button Click Counts in WooCommerce

Add Buy 2 Get 1 Free Offer Using Custom Code

Since WooCommerce doesn’t provide a built-in BOGO feature, you can add the following PHP code to your theme’s functions.php file. This method ensures that:

Also Read: How to Add Extra Fees in WooCommerce (Without a Plugin)

Custom PHP Code for Buy 2 Get 1 Free (BOGO) Offer in WooCommerce

How This Works:

Looking for a Freelance WordPress Developer?

Are you in need of a skilled WordPress developer to bring your website vision to life?
Look no further! Whether you need custom themes, plugin development, site optimization, or ongoing support, I offer expert WordPress development services to suit your needs.

Apply the Discount Only for Specific Categories

If you want the BOGO offer to apply only to specific product categories, modify the code like this:

Apply the Offer for Buy 1 Get 1 Free Offer

If you want to apply the offer Buy 1 Get 1 Free, replace this condition:

Exclude specific products from the BOGO offer

You can add an exclusion list inside the loop:

Apply the offer only for first-time buyers

You can check if the user has previous orders before applying the discount:

Are you want to get implementation help, or modify or extend the functionality?

A Tutorialswebsite Expert can do it for you.

Conclusion

A Buy 2 Get 1 Free offer is a great way to increase sales and customer satisfaction. You can implement it using custom PHP code for full control and flexibility.

By following this guide, you can easily integrate BOGO promotions into your WooCommerce store and customize them to suit your business needs.

Thanks for reading 🙏, I hope you found Track Add to Cart Button Click Counts in WooCommerce tutorial helpful for your project. Keep learning! If you face any problems – I am here to solve your problems.

FAQs

Does WooCommerce have a built-in Buy 2 Get 1 Free feature?

No, WooCommerce does not have a built-in feature for BOGO (Buy One Get One Free) promotions. However, you can achieve this using custom PHP code or third-party plugins.

Will this custom code work with variable products?

Yes, the code works with both simple and variable products.

Can I apply this offer to specific product categories only?

Yes! You can modify the code to restrict the discount to specific categories.

Will this discount be visible to customers before checkout?

No, the discount is applied at checkout. If you want to show a message on the product page or cart, you can use:

add_action(‘woocommerce_before_cart’, function() {
echo ‘
Buy 2 Get 1 Free offer is applied at checkout!
‘;
});

Will this work with other WooCommerce discounts or coupons?

Yes, but you need to test compatibility with other discounts. Some coupons may override this discount, so ensure they don’t conflict.

Exit mobile version