=== Giftvo - Tiered Gifts for WooCommerce ===
Contributors: serdarkeskin
Tags: free gift, gift, cart, promotion, threshold
Requires at least: 5.6
Tested up to: 7.1
Requires PHP: 7.2
WC requires at least: 6.0
WC tested up to: 9.3
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically add free gifts to the cart when customers reach spend thresholds. Unlimited tiers, customer-chosen gifts and a live progress bar.

== Description ==

Reward customers with a free gift as their cart grows. Set one or more spend thresholds and pick the product(s) that unlock at each level. The gift is added to the cart as a real line item priced at 0.00, so it works with every payment gateway (no fake coupons, no negative‑fee tricks).

**Features**

* **Unlimited tiers** — different gift(s) at each spend level.
* **Give all or let the customer pick** — a tier can hand over every listed product, or offer several and let the shopper choose one in the cart (with product thumbnails).
* **Colour / variation choice** — offer a variable product as a gift and the customer selects the variation right in the cart.
* **Threshold basis** — count the subtotal incl. or excl. tax, before or after discounts.
* **Cumulative or highest‑only** — stack the gifts of every reached tier, or give just the top one.
* **Live progress bar** — “Spend €X more to unlock a free gift!” with a gift marker for every threshold, on the cart, mini‑cart and via the `[gift_progress]` shortcode.
* **Free‑shipping goal** — optionally add a 🚚 milestone to the same bar (“Spend €X more for free shipping!”). It’s a plain amount you set, independent of any shipping plugin, and can be switched off in Settings.
* **Discount milestones** — add as many % milestones as you like (e.g. 5% from €1,000, 6% from €2,000 …) so shoppers see every step of a tiered discount on the same bar (“Spend €X more for 6% off!”). Giftvo only shows the milestones; the discount itself comes from your pricing or discount plugin.
* **Proportional or evenly spaced bar** — place markers at their amount, or give every milestone the same room so many steps stay readable on phones. Milestones at almost the same amount (e.g. free shipping at €999 and a discount at €1,000) share one marker.
* **Crossed‑out value** — show the gift’s normal price struck through next to “Free”.
* **Celebration** — an optional confetti burst when a new gift is unlocked.
* **Stock aware** — automatically skips a gift that is out of stock.
* **Gateway safe** — the gift is a genuine 0.00 line item; the basket total always matches the amount charged.
* **White‑label ready** — set the menu title, badge text, “Free” label and accent colour; import/export the whole configuration as JSON.
* **Translation ready** — text domain `giftvo`; translations are delivered through translate.wordpress.org.
* **HPOS compatible** — declares compatibility with WooCommerce High‑Performance Order Storage.

== Installation ==

1. Upload the `giftvo` folder to `/wp-content/plugins/`, or install the ZIP via Plugins → Add New → Upload.
2. Activate the plugin.
3. Go to **WooCommerce → Gift Products** and add your tiers.

== Frequently Asked Questions ==

= Is it safe with PAYONE / Klarna / PayPal? =
Yes. The gift is a real product line priced at 0.00, so the basket sum equals the amount charged. There are no coupon or fee lines that could cause a mismatch.

= Does it work with the block‑based Cart & Checkout? =
The gift is still added correctly, but the on‑page display (badge, crossed‑out price, colour switcher, progress bar) is built for the classic **shortcode** Cart & Checkout. If your store uses the newer WooCommerce Cart/Checkout **blocks**, switch those pages to the `[woocommerce_cart]` / `[woocommerce_checkout]` shortcodes to see the full experience.

= What currency do thresholds use? =
Thresholds are plain numbers in your store’s base currency (e.g. `1500` = 1,500 in the shop currency). If you run a multi‑currency plugin, note that thresholds are **not** auto‑converted between currencies.

= Can the customer choose the gift? =
Yes. Set a tier’s mode to “Customer picks one”, add several products, and the shopper chooses one in the cart. Variable gifts also let them pick the colour/variation.

= Does Giftvo apply the discount milestones? =
No. Discount milestones are a display feature: they show shoppers how far they are from each discount step. Create the discount itself with your pricing or discount plugin and enter the same amounts and labels in Giftvo.

= How many tiers and milestones can I add? =
As many as you need — gift tiers and discount milestones are both unlimited. With many milestones, choose the “Evenly spaced” bar scale so the markers stay readable on small screens.

= Does the threshold include tax? =
Your choice. Under Settings you can base it on the subtotal incl. or excl. tax, before or after discounts.

== Upgrade Notice ==

= 1.2.0 =
Unlimited discount milestones and an evenly spaced progress bar option. Existing settings are kept; a single discount milestone is moved into the new list automatically.

== Screenshots ==

1. Cart with two unlocked gifts, crossed‑out prices and the colour switcher.
2. Progress bar with a gift marker at every threshold.
3. The settings screen: tiers, modes and options.

== Changelog ==

= 1.2.0 =
* New: unlimited discount milestones on the progress bar — add one row per discount step (amount + label, e.g. 1000 → “5%”). A 1.1.0 single discount milestone is moved into the list automatically.
* New: “Evenly spaced” progress bar scale — every milestone gets the same room, so bars with many steps stay readable on phones. “Proportional” stays the default.
* Milestones at almost the same amount are drawn as one combined marker, and the message names everything the next step unlocks (e.g. “Spend €21 more for free shipping + 5% off!”).
* Translations now load from translate.wordpress.org (no bundled language files).

= 1.1.0 =
* New: optional free‑shipping goal on the progress bar — adds a 🚚 milestone (“Spend €X more for free shipping!”) alongside the gift markers. Set the amount and toggle it in Settings; it’s independent of any shipping plugin.
* Markers that share the same threshold (e.g. a gift tier and the free‑shipping goal set to the same amount) are merged into a single combined marker so the icons never overlap.
* Updated English, German and Turkish translations.

= 1.0.0 =
* Initial release.
* Unlimited gift tiers with a real 0.00 line item (safe for every payment gateway).
* “Give all” or “customer picks one” gift modes with product thumbnails.
* Colour/variation choice for variable gifts, selectable in the cart.
* Configurable threshold basis (tax in/out, before/after discounts) and cumulative vs highest‑only stacking.
* Live progress bar with a marker and amount label per threshold (toggleable) (cart, mini‑cart, `[gift_progress]` shortcode).
* Crossed‑out original price, optional confetti celebration, stock‑awareness.
* White‑label options (menu title, badge, label, accent), JSON import/export, uninstall cleanup.
* English, German and Turkish translations. HPOS compatible.
