=== Product Bundles and Gift for WooCommerce ===
Contributors: catcodestudio
Tags: woocommerce, bundle, frequently bought together, free gift, upsell
Requires at least: 5.6
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Product bundles at a special price, a "Frequently bought together" block on the product page, and a free gift added automatically above an order total.

== Description ==

Two proven ways to raise the average order value — sell in sets and give a present for spending more. This plugin does both, without a separate bundle product type and without rewriting the theme.

= Product bundles =

* A set of two or more products: a special bundle price, a percentage discount or a fixed amount off.
* A "Frequently bought together" block on the page of every product in the set: images, names, prices, the total before and after the discount.
* One click adds the whole bundle to the cart.
* The discount is added as its own line in the cart and order totals, so the shopper sees exactly what they saved on.
* A bundle fires as soon as all of its products are in the cart, no matter how they got there. Two complete bundles mean a double discount.
* The discount never exceeds the value of the bundle itself.

= Free gift above an order total =

* A cart total threshold above which a gift product is added to the cart automatically.
* The gift quantity is locked to 1 and the line cannot be removed by hand.
* As soon as the total drops below the threshold, the gift disappears on its own.
* A progress hint in the cart: "Spend N more and get ...".
* A "Gift" badge on the cart line and on the order item.

= Compatibility =

* Classic cart and checkout as well as the block-based ones (Store API) — the bundle discount and the gift are recalculated the same way in both.
* HPOS (custom order tables).

= Pro features =

* An unlimited number of bundles and gift thresholds.
* Conditions: product category, tag, user role.
* Several gifts on one threshold — the shopper picks one.
* A schedule for the promotion (active from / to).
* Rule priority.
* Product variation support, both inside bundles and as a gift.

A fresh install is simply the free tier: one bundle and one gift threshold, working for as long as you like. Nothing switches itself on. The Pro features are shown where they belong, greyed out, and unlock either with a licence key or with a 7-day trial you start yourself — one click, an e-mail address, no card. The licence is annual (1–5 years) and includes updates and support for that term.

= Requirements =

* WooCommerce 6.0 or newer
* PHP 7.4+

The plugin interface is fully translated into Ukrainian. / Інтерфейс плагіна повністю перекладено українською.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/product-bundles-and-gift-for-woocommerce/`
2. Activate it in the "Plugins" menu
3. Go to WooCommerce → Набори та подарунки (Bundles and gifts)
4. For a bundle: enable the card, pick 2 or more products, choose the discount type and its value
5. For a gift: enable the card, set the total threshold and the gift product

== Frequently Asked Questions ==

= Do I have to create a separate "bundle" product? =

No. A bundle is made of ordinary catalogue products; their stock and prices stay untouched.

= Does the discount apply if the shopper added the products one by one? =

Yes. The only condition is that every product of the bundle is in the cart.

= What happens when the shopper removes one product of the bundle? =

The discount line disappears from the totals and the remaining products stay in the cart at their regular prices.

= Can the gift quantity be changed, or the gift removed? =

No. The quantity is locked to 1, the remove button is hidden for that line, and the Store API marks it as non-editable. The gift only goes away when the cart total falls below the threshold.

= Does the gift work in the block-based cart? =

Yes. It is added while the totals are being calculated, and the Store API recalculates them on every request.

= How do I set several thresholds — one gift from 1000, another from 2000? =

That is a Pro feature. Add two thresholds; the one with the highest amount among those reached wins.

= Which amount is the gift threshold measured against? =

The cart line totals at their own prices, excluding the gift itself and excluding shipping.

== Screenshots ==

1. Bundle settings.
2. Gift thresholds and the extra conditions.
3. The "Frequently bought together" block on the product page.
4. The gift and the progress hint in the cart.

== Changelog ==

= 1.1.0 =
* The Pro trial no longer starts by itself. A fresh install is the free tier until the owner clicks "Try Pro for 7 days" and receives a real key by e-mail.
* Licence keys are now verified against catcode.com.ua (activate on save, re-check once a day, 14-day offline grace) instead of being accepted offline.
* Pro settings stay visible in their own place, greyed out, with a badge and one line explaining what each of them does.
* Saving the settings no longer wipes the licence key or the stored Pro values.
* One dismissible notice, shown only after a bundle discount or a gift has actually fired — dismissed once, gone for good.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.1.0 =
The automatic 7-day Pro trial is gone: nothing switches itself on any more. Start the trial yourself when you want it.

= 1.0.0 =
Initial release.
