WooCommerce BOGO for Variable Products in 2 Simple Methods

Bogo offer for variable products

WooCommerce BOGO for Variable Products in 2 Simple Methods

BOGO offers are one of the most effective ways to increase sales in WooCommerce, but setting them up for variable products can be more challenging than simple products. When a product has different sizes, colors, models, or variations, you need to make sure the offer applies to the right variation and gives the correct free product to the customer.

For example, you may want to offer “Buy 1 Get 1 Free” only for a specific T-shirt color, or let customers buy one product variation and choose a free gift from another category. In these cases, a basic discount is not enough because the rule must understand product variations, quantities, gift products, and cart conditions.

In this tutorial, you’ll learn how to apply a BOGO offer for WooCommerce variable products using custom code and GIFTiT – Free Gifts for WooCommerce. We’ll explain how Buy X Get X and Buy X Get Y offers work, how to target specific product variations, and how to create flexible free gift rules without editing every product manually.

Stores can approach this goal in several ways. If you are configuring BOGO rules for variable products, WooCommerce gift offer strategies provides a useful starting point.

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
bogo in result

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.

Read more: How to install the GIFTiT – Free Gifts for WooCommerce plugin?

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
Open GIFTiT 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
Add new rule
GIFTiT - Free Gifts For WooCommerce plugin by ithemeland

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
Buy x get x rule for variable products

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
BOGO rule result in cart page

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
Fill the rule from as picture

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
Let customer choose gift from specific category

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
Accessory category as free gift in cart

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
Date and time conditions

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
Set date condition

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
Cart subtotal price conditions

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 gift for specific user roles

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
Free gift based on purchase history

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

GIFTiT - Free Gifts For WooCommerce plugin by ithemeland

Conclusion

Creating a BOGO offer for WooCommerce variable products is a smart way to promote specific variations, clear stock faster, and encourage customers to buy more. You can use this strategy for clothing sizes, product colors, seasonal variations, bundled campaigns, or any product group where one variation needs extra promotion.

The custom code method can work if you have development experience and only need a very specific rule. However, it is harder to manage, less flexible for store owners, and riskier if you need to change the offer regularly.

For most WooCommerce stores, GIFTiT – Free Gifts for WooCommerce is the easier and more practical option. It helps you create Buy X Get X and Buy X Get Y offers, target specific variable products or variations, auto-add gifts to the cart, and control gift rules with conditions such as date, cart subtotal, user role, or purchase history. This gives you more control over BOGO campaigns while keeping the setup simple and manageable.

The best results come from choosing rules that match your store goals. For more campaign ideas, explore this comperhensive resource.

FAQ

1. What is a BOGO offer for WooCommerce variable products?

A BOGO offer for WooCommerce variable products is a promotion where customers buy one or more product variations and receive another product or variation for free or as a reward. For example, customers can buy one blue T-shirt variation and get another one free.

2. Can I create Buy One Get One offers for specific variations?

Yes. You can create BOGO offers for specific product variations, such as a certain size, color, or model. This is useful when you want to promote selected variations instead of applying the offer to the entire variable product.

3. What is the difference between Buy X Get X and Buy X Get Y?

Buy X Get X means customers buy a product and receive the same product or variation as a gift. Buy X Get Y means customers buy one product and receive a different product, category item, or selected gift.

4. Can I auto-add the free gift to the WooCommerce cart?

Yes. With GIFTiT, you can enable auto-add gift rules so the free product appears in the cart automatically when the customer meets the BOGO conditions.

5. Is coding a good way to create BOGO offers for variable products?

Coding can work for simple and fixed scenarios, but it is not ideal for most store owners. If you need to change products, variations, conditions, or gift rules often, using a plugin is easier and safer.

6. Can I limit BOGO offers by date or customer role?

Yes. You can limit BOGO offers by date, cart subtotal, user role, login status, purchase history, and other conditions. This is useful for seasonal campaigns, VIP customers, or targeted promotions.

7. Why should I use BOGO offers for variable products?

BOGO offers help increase cart value, promote selected variations, move slow-selling stock, and make product campaigns more attractive. They work especially well for clothing, accessories, cosmetics, food items, and seasonal products.

Related Articles

You might also be interested in these articles

Reader Comments

Join the conversation and share your thoughts

Leave a Reply

Start Your Journey

Sign in / Sign up account to continue