Blog

How to Apply BOGO Offer for Variable Products in WooCommerce?

Bogo offer for variable products
Table of Contents

Apply BOGO offer for variable products in WooCommerce is one of the best marketing strategies for boosting online store sales. Buy one get one for variable products is very helpful when one of the variations remains in stock and you need to encourage customers to buy that specific variation in a short while.

In this post, we want to show you how to apply BOGO offer WooCommerce for variable products in two ways:

  1. Apply BOGO offer for variable products by coding (without plugin)
  2. Offer BOGO offer for variable products By using free gifts for WooCommerce plugin.

Apply BOGO offer for variable products in WooCommerce by coding

The easiest solution to offer a buy one get one promotion for variable products in WooCommerce is inserting a piece of code in function.php. This method is useful for store managers who are experts in coding and have enough knowledge about working with WordPress databases.

If you have decided to get help from this method, consider the following points:

  • Backup your WordPress database to restore your site in case of any problems.
  • Create a child theme before applying this code.
  • Ask an expert to do this task if you have no experience in coding.

Now, you can use the following code to apply BOGO offers for variable products. This code can apply for a variable product with ID no.15 (Hoodie-Red) and the scenario is like the below:

If customers buy 2 Hoodie-Red, they can get one for free.

Here, you can find the related code:

add_action('woocommerce_cart_calculate_fees', 'ts_add_custom_discount_2nd_at_50', 10, 1 );
function ts_add_custom_discount_2nd_at_50( $wc_cart ){
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return;
$discount = 0;
$items_prices = array();
// Set here your targeted variable product ID
$targeted_product_id = 15;
foreach ( $wc_cart->get_cart() as $key => $cart_item ) {
if( $cart_item['product_id'] == $targeted_product_id ){
$qty = intval( $cart_item['quantity'] );
for( $i = 0; $i < $qty; $i++ )
$items_prices[] = floatval( $cart_item['data']->get_price());
}
}
$count_items_prices = count($items_prices);
if( $count_items_prices > 1 ) foreach( $items_prices as $key => $price )
if( $key % 2 == 1 ) $discount -= number_format($price / 2, 2 );
if( $discount != 0 ){
// Displaying a custom notice (optional)
wc_clear_notices();
wc_add_notice( __("You get 50% of discount on the 2nd item"), 'notice');
// The discount
$wc_cart->add_fee( 'Discount 2nd at 50%', $discount, true );
}
}

You can replace the ID no. – in the yellow highlighted line -to apply BOGO offer WooCommerce for variable products on your website.

As a result, when the customers add 2 Hoodie-Red to their WooCommerce cart, the discount applies to the second variable product as illustrated below.

result BOGO offer for variable products in WooCommerce by coding

Apply buy one get one for variable products by free gift for WooCommerce plugin

Free gifts for WooCommerce is a practical solution for offering different types of BOGO offers or other promotional plans like buy x get y, subtotal, etc. With an easy-to-use interface and various conditions that you can set to customize the rule, this is one of the best tools for applying BOGO offers for variable products in your WooCommerce store.

Let’s review the step-by-step guide for running BOGO offer WooCommerce for variable products with this plugin.

Step 1: Install the free gifts for WooCommerce plugin

The first step for using free gift for WooCommerce plugin is downloading and installing it on your WordPress website. After activation, you can go to the below address to see the Rules page:

WordPress Dashboard > Woo Free Gift > Rules | Settings 

select rules and settings section in Woo Free Gift Plugin

On the rules page, you need to press the Add Rule button to create a new gift offer rule.

select Add Rule button in rules page
woocommerce gift plugin banner

Step 2: Set BOGO (Buy One Get One) Offer for variable products in WooCommerce

To apply BOGO offer WooCommerce for variable products in your online store, you can use one of the following scenarios:

  • Buy x get x method: When customers order one variable product get another one (the same product) for free.
  • Buy x get y method: When customers order one variable product get another product (different from the ordered product) for free.

Let’s review both scenarios by making some examples:

Example 1: Apply BOGO with the buy x get x method

To run this type of BOGO offer for variable products in your online shop first you need to choose “Buy x Get x” from the Method field. (1) By selecting this method, you can see three boxes in the Rule form, including 

  • Quantities & Settings: In this section, you can set the Buy and Get quantities.
  • Product Buy: This section allows you to specify the product that customers must add to their carts to receive the free gift.
  • Condition: You can set some conditions in this part to limit offering BOGO deals. 

Now, suppose that you want to set the BOGO offer for the V-Neck T-Shirt Blue product. To make this happen, follow the below instructions:

In the Quantities & Settings section:

  • Insert 1 for both Buy and Get quantity fields (2) which means when customers buy one product they will receive one gift.

Mark Auto Add Gift to Cart (3) to instruct the plugin to add the free gift to the customer’s cart, automatically.

Apply BOGO with buy x get x method in rules form

In the Products section:

  • Press the Add Product button.
  • Choose Product Variation from the first drop-down list(4).
  • Set In list for the second field.
  • Add V-Neck-T-Shirt-Blue to the product selection field(5).

You can set other conditions in the Condition box if you need to (This is optional).

Finally, press Save changes to apply buy one get one for variable products in your store which means when customers order one V-Neck-T-Shirt-Blue, they will receive another one for free in their cart:

result BOGO with buy x get x method in online shop

Example 2: Apply BOGO with the buy x get y method

In this example, we want to set the BOGO rule for the below scenario:

When customers order one V-Neck-T-Shirt-Blue, they can choose one free product from the Accessories category.

As we mentioned in the previous example, the first step for creating any rule in free gifts for WooCommerce plugin is choosing the right method from the list. To apply this rule, we need to select the Buy X Get Y (1) method to see four sections in the rule form, including:

  • Quantities & Settings: Same as the previous example.
  • Product-Buy: Same as the previous example.
  • Product-Get: In this section, you can specify which products must be offered as free gifts to the customers.
  • Conditions: Same as the previous example.

Now, by following the below steps, you can apply BOGO with the buy x get y strategy in our plugin: 

  • Insert 1 in both the Buy and Get quantity field (2).
  • Choose the variable product in the Product-Buy section as we mentioned in the previous example.
  • In the Product Get section, customize the free gift by using the following fields: (4)
    • Include product: Choose one or more products from your online store to offer as free gifts to the customers.
    • Include category/tags/taxonomy: Choose one specific category, tag, or taxonomy to offer the products related to it as free gifts to the customers.
    • Exclude product: Add one or more products in this field to exclude them from the list of free gifts.
    • Exclude category/tags/taxonomy: Add one specific category, tag, or taxonomy to exclude the products related to it from the list of free gifts.
Apply BOGO with buy x get y method in rules form

In this example, we want to let customers choose their gift from the products in the Accessory category. So, we set Accessories in the Include Category/Tag/Taxonomy field.

select Include Category/Tag/Taxonomy field in Products Get section

Finally, press “Save changes” to apply the rule in your online shop. (5)

As you can see in the below picture when customers order one V-Neck-T-Shirt-Blue, they will see a list of products in the Accessory category and they can add one of them to their cart for free.

result BOGO with buy x get y method in online shop

Extra Feature for applying BOGO offers for variable products

You can set extra conditions in BOGO offers for variable products by using the default options available in the Condition section of our plugin. The items designed in this section are very flexible allowing you to run the BOGO in different situations.

Let’s review some of them.

Create BOGO offer WooCommerce for variable products on a specific date

If you want to offer the BOGO deal on a specific date like Christmas, Black Friday, etc. you can easily choose Date from the Date & Times tab:

Create BOGO offer WooCommerce for variable products on specific date

Then you can use a built-in calendar to set a specific date to apply the BOGO rule on your online store:

select calendar to set a specific date in conditions section

Offer buy one get one for variable products with cart subtotal price limitation

It is also possible to offer BOGO deal to the customers that their cart subtotal price is more than a specific amount. To make this happen, you can simply choose Cart subtotal price from the Cart tab in the Condition section and then set a minimum price in the related field:

Offer buy one get one for variable products with cart subtotal price limitation

Set BOGO offer for variable products to specific customers’ role

One of the most popular conditions for offering a buy one get one promotion is appreciating loyal customers. In free gifts for WooCommerce plugin, you can set conditions to limit offering BOGO deals based on user role to fulfill this purpose.

For example, if you want to offer this giveaway to the sales managers who order products from your shop regularly, it is possible to choose User Role from the Customer tab and set the BOGO deal for the Sales Managers role only – It is worth mentioning that you need to create sales managers in the WordPress and assign some of your customers to this user role.

It is also possible to offer the BOGO promotion to the registered customers by choosing Is logged in from the list as illustrated below: 

Offer BOGO for variable products to specific customers role

Set BOGO offer for variable products based on purchase history

Sometimes you want to appreciate your loyal customers by offering BOGO deals. One of the best ways to make your loyal customers happy is by offering free gifts when they have already ordered products from specific categories, variations, tags, etc. 

If you want to apply this strategy, go to the Purchase History in the Condition box then choose one of the options which is suitable for your marketing strategy.

Set BOGO offers for variable products based on purchase history

Then you can limit the BOGO offer to the customers based on the specified Purchase history.

woocommerce gift plugin banner

Conclusion

Offering Buy One Get One for variable products is important for boosting sales of e-commerce websites because customers look for them and actively order products from online shops that offer better deals. To offer a ” BOGO deal in WooCommerce for variable products” as one of the most popular promotions you can use the Free Gift for WooCommerce plugin. It comes with helpful tools and options for offering various kinds of promotional plans with flexible conditions.

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha loading...

Shopping cart
Sign in

No account yet?

We use cookies to improve your experience on our website. By browsing this website, you agree to our use of cookies.

Start typing to see products you are looking for.
1-5 of 424 reviews
  1. D

    Amazing plugin! I can’t say enough good things about it. Highly recommended.

  2. S

    As a busy store owner, I needed a solution to streamline my order management process. This plugin has been a lifesaver. I can now process bulk orders quickly and easily.

  3. K

    I just had a issue with this plugin and the tech team was very quick to help me solve the problem, great!

  4. S

    Very helpfuls support team. My issue was resolved within 2 days.

  5. A

    its what i want and its good