Description
SaleMint — Buy One Get One adds “buy X, get Y” offers to WooCommerce products. You can run a different offer on each product, give away the same product or a different one, make the free item fully free or a percentage off, schedule an offer to start and end on set dates, and stop other coupons from stacking on top of it.
Here is how it works for a shopper. They open a product page and see “Buy 2, get 1 free!” under the price. They add two to the cart, and a third unit appears as its own line, priced at 0, with the original price struck through. If they drop back to one, the free unit disappears. If they try to delete the free line or change its quantity, it goes back to what they earned. At checkout the free line is saved in the order with an “Offer: Buy 2, get 1 free!” note, which shows on the thank-you page, in My Account, in the order emails and on the admin order screen.
You set it up in two places you already know: a BOGO tab under WooCommerce > Settings, and a BOGO tab in the Product data box when you edit a product.
What you can sell with it
- “Buy 1, get 1 free” on a T-shirt, where the free unit is the same size and colour the customer picked.
- “Buy 3 candles, get 1 free” on one product, while the rest of the store keeps a “Buy 1, get 1” default.
- “Buy a laptop, get a laptop sleeve free”, where the free item is a different product (or one variation of it).
- “Buy one, get the second at 50% off”, or any other percentage from 1 to 99.
- A Black Friday offer that starts on the Friday and ends on Monday night, and switches itself on and off.
A store-wide default, with per-product control
Under WooCommerce > Settings > BOGO you set the default rule: how many units the customer buys and how many they get free, plus whether the free item is fully free or a percentage off. There is also a master switch. Turn it off and every offer stops at once, but your product settings stay saved, so you can turn them back on later.
The default never applies to a product by itself. You choose which products have an offer by ticking Enable BOGO offer in the product’s BOGO tab. Each product can then use the global quantities or its own (Buy 3, get 1, for example), and the global discount or its own.
You can also turn BOGO on or off for many products at once from Quick Edit and Bulk Edit on the Products list. A BOGO column shows which products have an offer and whether they use the global or custom quantities (“Global”, “Custom 3+1”), and whether the offer is scheduled or has ended. A BOGO enabled filter lists only the products that have one.
Same product or a different product
For each product, choose what the customer gets for free:
- Same product: another unit of what they bought. On a variable product, it’s the same variation, so someone who buys a large red shirt gets a large red shirt free.
- A different product: one product you pick from a search box. It can be a simple product or one specific variation (“buy any colour of this hoodie, get the black beanie free”).
If the free product is later deleted, trashed or can no longer be bought, the trigger product keeps selling at its normal price and no free item is added. The product’s BOGO tab shows a warning so you know to fix it. The plugin never quietly switches to giving away the trigger product instead.
How the cart works
The free item is a real cart line, separate from the paid units, so customers can see exactly what they got. The plugin keeps it in step with the cart every time the cart changes:
- Multiples are counted. With “Buy 2, get 1”, five paid units earn two free units. Remainders round down.
- Free units don’t count toward the offer. Two paid units with “Buy 1, get 1” give two free units, not four.
- Variations count together. On a variable product, one red and one blue shirt add up to two units toward the offer. When the paid units span several variations, the free units copy the cheapest ones first.
- Stock is respected. If the free product is out of stock, the customer is told and the paid item stays in the cart at full price. If only some free units are in stock, the plugin adds those and says so. Products that allow backorders are added normally.
- The free line is locked. Its quantity shows as plain text and there’s no remove link. If a customer removes it anyway, it comes back with a short note that free items are part of the offer.
- Checkout checks again. Free lines are recounted right before payment, so a tampered cart can’t check out more free items than it earned.
Customers get a short notice when something changes, such as “You got 1 × Small Wool Plate free!”, and they only see it once.
Free or a percentage off
The “free” item can be completely free, or discounted by a percentage (1 to 100). The percentage comes off the product’s current price, sale price included, and is rounded to your store’s decimal setting. Taxes and shipping are worked out by WooCommerce in the usual way. The free line still ships, so it still counts toward shipping weight.
In the cart a fully free line shows the original price struck through and a “Free” badge. A discounted line shows the original price, the new price and a label such as “50% off”.
Offer start and end dates
Each product can have an optional Offer starts and Offer ends date. The offer starts at 00:00 on the start date and ends at 23:59:59 on the end date, in your store’s timezone (Settings > General), not the server’s. Set only a start date to run it with no end, or only an end date to run it from now until then.
When an offer ends, any free item still sitting in a cart is taken out on the next cart update, and the customer is told the offer has ended. Orders placed before the end keep their free item. Nothing depends on WP-Cron, so it works on sites with cron turned off.
Stop coupons from stacking
A 20% coupon on top of a free item is the quickest way for a BOGO promotion to lose money. With Block coupons when a BOGO offer is applied on (it’s on by default), customers can’t apply a coupon while their cart holds a free item. They see “Coupons can’t be combined with the Buy One Get One offer in your cart.”
It works in either order. If the customer applied a coupon first and then earned the free item, the coupon is removed and they’re told why. If they later drop below the offer quantity, they can enter coupons again.
Some codes should always work, such as a free-shipping code. Add those to Allowed coupons. The field searches your coupons as you type, so it stays quick even with thousands of coupons.
Offer message on the product page
Shoppers can’t take an offer they don’t know about. The plugin shows a short message on the single product page, in one of four styles:
- Simple: “Buy 2, get 1 free!” or “Buy 1, get 1 at 50% off!”
- Gift: “Buy 1 and get 1 × Laptop Sleeve free!”, with a link to the free product.
- Badge: the same text in a highlighted box.
- Minimal: “BOGO offer: 2+1”.
Choose where it goes: above the add to cart button, below it, or below the price. The settings page shows a live preview of the template you pick. Each product can use the global template, pick a different one, or hide the message.
The message only appears while the offer is actually running and the free item is in stock, so you never advertise something the cart can’t give. It works in classic themes and in block themes (next to the Add to Cart Form block or under the Product Price block).
Cart and Checkout blocks
Everything above works the same in the Cart, Checkout and Mini-Cart blocks as in the classic cart. In the blocks, a free line is named “Product – Free” or “Product – 50% off”, the regular price is struck through, and there’s no quantity selector or remove link. The plugin’s notices show up as normal block notices.
Express payment buttons such as Apple Pay and Google Pay in the block cart include the free line in the total, because the cart is calculated before payment.
Orders, emails and stock
When the order is placed, each free line keeps its “Offer” note, and the plugin saves the original price, the discount and the product that earned it. Customers see the note on the thank-you page, in My Account and in their order emails. Packing slip and invoice plugins that read the normal order items show the free line with no extra setup.
On the admin order screen, free lines get a Free item badge (or “BOGO item: 50% off”) and the original price, so whoever packs the order knows it wasn’t charged by mistake. When you open the refund form on an order that has free items, a reminder points out that refunding the paid products doesn’t touch the free ones, so you can decide what to do with them.
Stock goes down for free items like any other line, and comes back when an order is cancelled or a refunded item is restocked. That’s all WooCommerce core; the plugin doesn’t change it. Free lines in orders you edit in the admin keep their saved price, and the plugin doesn’t re-run offers on them.
If a customer clicks Order again, a free line never comes back as a paid one. It returns as a free line and stays only if the new cart still earns it.
Compatibility
- Classic cart and checkout, and the Cart, Checkout and Mini-Cart blocks.
- High-Performance Order Storage (HPOS) and legacy order storage. Orders are only read and written through the WooCommerce CRUD API.
- Simple and variable products. Grouped and external products can’t be added to the cart as one line, so they don’t get a BOGO tab.
- Translation-ready, with the
salemint-buy-one-get-one-for-woocommercetext domain.
For developers
Templates can be overridden from your theme. Copy a file from the plugin’s templates/ folder to yourtheme/salemint-bogo/, keeping the same sub-folders:
single-product/offer-message.php: the product page message.cart/free-item-price.php: the struck-through price and badge in the classic cart.admin/order-item-badge.phpandadmin/order-refund-warning.php: the admin order screen.
Change the theme folder with the salemint_bogo_theme_template_path filter.
To tell a free line from a paid one in your own code, use salemint_bogo_is_free_cart_item( $cart_item ) for cart items and salemint_bogo_is_free_order_item( $item ) for order items.
Useful filters:
salemint_bogo_product_rule: change or remove the offer that applies to a product.salemint_bogo_rule_is_active: decide whether a scheduled offer is running right now.salemint_bogo_free_product_id: change which product is given away.salemint_bogo_earned_free_qty: change how many free units a cart earns.salemint_bogo_free_item_price: price the free line yourself.salemint_bogo_discount_types: register extra discount types.salemint_bogo_block_couponandsalemint_bogo_prefer_coupon: decide per coupon whether it’s blocked, or let the coupon win over the free item.salemint_bogo_message_templatesandsalemint_bogo_offer_message: add message templates or change the final message HTML.salemint_bogo_order_item_offer_text: the “Offer” text saved on order lines.salemint_bogo_supported_product_types: allow the BOGO tab on other product types.
Actions:
salemint_bogo_free_item_added,salemint_bogo_free_item_updatedandsalemint_bogo_free_item_removed: a free line changed in the cart.salemint_bogo_order_free_items_recorded: free lines were saved to a new order.salemint_bogo_product_settings_saved: a product’s BOGO tab was saved.
Screenshots









Installation
Requirements
- WordPress 6.5 or later
- WooCommerce, installed and active
- PHP 8.0 or later
Install from your dashboard
- Go to Plugins > Add New Plugin.
- Search for “SaleMint Buy One Get One”.
- Click Install Now, then Activate.
Install manually
- Download the plugin zip.
- Go to Plugins > Add New Plugin > Upload Plugin, choose the zip and click Install Now. You can also unzip it and upload the
salemint-buy-one-get-one-for-woocommercefolder to/wp-content/plugins/over FTP. - Activate it from the Plugins screen.
Set up your first offer
- Go to WooCommerce > Settings > BOGO.
- Tick Enable BOGO offers, set the default Buy quantity and Free quantity, and pick the default Free item discount. Save.
- Edit a product and open the BOGO tab in the Product data box.
- Tick Enable BOGO offer. Leave the other options on their defaults for a plain “Buy 1, get 1 free”, or set custom quantities, a different free product, a percentage discount, dates or a message style.
- Update the product and add it to the cart on your store to see the offer work.
FAQ
-
Does it need WooCommerce?
-
Yes. WooCommerce must be installed and active. The plugin declares WooCommerce as a required plugin, so WordPress won’t activate it without WooCommerce.
-
I set the global rule, but nothing happens in the cart. Why?
-
The global rule is only a default. It doesn’t turn the offer on for any product by itself. Open a product, go to its BOGO tab and tick Enable BOGO offer. Also check that Enable BOGO offers is ticked under WooCommerce > Settings > BOGO, and that the product’s offer dates (if any) include today.
-
Can I run an offer on every product at once?
-
Not with one switch. Use Bulk Edit on the Products list to enable BOGO on as many products as you like in one go. Each of them then uses the global quantities unless you give it its own.
-
Does it work with variable products?
-
Yes. The offer is set on the parent product and covers all its variations. Units of different variations count together, so one red and one blue shirt count as two. In “Same product” mode the free unit matches the variation the customer bought. In “A different product” mode you can pick one specific variation of any product as the gift.
-
Can customers remove the free item?
-
No. The free line has no remove link and its quantity can’t be changed. If it’s removed some other way, it’s added back with a short explanation. If a customer doesn’t want it, they can reduce the paid quantity below the offer.
-
What happens when the free product runs out of stock?
-
The customer is told that the free item is out of stock, and the product they’re paying for stays in the cart at its normal price. The offer message is hidden on the product page until the free product is back in stock. If only some units are available, those are added.
-
Can I give the second item at a discount instead of free?
-
Yes. Choose Percentage off as the discount, globally or per product, and enter a value from 1 to 100. A value of 100 is treated as fully free.
-
Will a coupon still work alongside the free item?
-
Not by default. While the cart holds a free item, other coupons are rejected, and a coupon applied before the free item was earned is removed. You can turn this off, or keep it on and add specific codes, such as free shipping, to Allowed coupons.
-
Does it support the Cart and Checkout blocks?
-
Yes, including the Mini-Cart block. Free lines are labelled, locked and priced the same way as in the classic cart. One limit: the newer Interactivity API Mini-Cart in WooCommerce 11 doesn’t run the block filters the label relies on, so it may show the free line without the “Free” label. The price and the quantity lock are still correct.
-
Is it compatible with HPOS?
-
Yes. Compatibility with High-Performance Order Storage is declared, and order data only goes through the WooCommerce CRUD API.
-
The offer message doesn’t show on my product page.
-
Check that the offer is running today, that the free item is in stock, that Show offer message on product pages is ticked, and that the product’s Message setting isn’t “Hide”. If all of that is fine, your theme may have removed the WooCommerce hook the chosen position uses. Try another position. In a block theme, the single product template needs the Add to Cart Form block or the Product Price block.
-
I changed the offer dates, but the product page still shows the old message.
-
A page cache is probably serving an older copy. The cart is never cached by WooCommerce-aware caching plugins, so the cart itself is always right. Clear the page cache, or wait for it to expire.
-
Does it change stock or refunds?
-
No. WooCommerce reduces stock for the free line like any other line and puts it back on cancellation or restock. Refunds are never changed automatically. The admin order screen only shows a reminder when you refund an order that contains free items.
-
Can I change how the message or the cart price looks?
-
Yes. Copy the template from the plugin’s
templates/folder intoyourtheme/salemint-bogo/and edit it there. See “For developers” above for the list of templates and hooks. -
What happens to my settings if I deactivate the plugin?
-
They stay in the database, so turning the plugin back on brings your offers back as they were. Orders placed while it was active keep their free lines and “Offer” notes either way.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“SaleMint — Buy One Get One for WooCommerce” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “SaleMint — Buy One Get One for WooCommerce” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.0.0
- Initial release.
- Global Buy X, get Y rule with a master switch.
- Per-product offers with global or custom quantities, plus Quick Edit, Bulk Edit, a Products list column and a filter.
- Free item can be the same product (same variation) or one chosen product or variation.
- Free items are added, updated and removed in the cart automatically, capped at available stock, and checked again at checkout.
- Free or percentage-off discount, globally and per product.
- Optional offer start and end dates in the store timezone.
- Coupon blocking while a free item is in the cart, with a list of allowed coupons.
- Product page offer message with four templates, three positions and a per-product override.
- Support for the Cart, Checkout and Mini-Cart blocks, and High-Performance Order Storage (HPOS).
- Free lines are marked in orders, emails and the admin order screen, with a refund reminder and safe Order again.
