=== Dosage & Bundle Manager ===
Contributors: rallios
Tags: woocommerce, dosage, bundles, product configurator, quantity discount
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Adds a dosage selector and quantity-based bundle options to WooCommerce product pages, with custom badges and live price updates.

== Description ==

Dosage & Bundle Manager lets store owners configure per-product dosage ranges and jar bundles. Customers pick a weight/dosage range and a bundle on the product page; quantity, pricing, and discounts stay in sync with WooCommerce add to cart.

Plugin URI: https://www.rallios.gr/portfolio/woocommerce-dosage-bundle-manager/
Author URI: https://www.rallios.gr

**Dosage selector**

* Enable a dosage selector per product.
* Define unlimited weight ranges with labels, kg bounds, tablets per day, and optional icons.
* Show tablets per day and tablets per month on the product page.

**Bundles**

* Enable independent bundle tiers (quantity + discount) per product.
* Bundles can be purchased even when dosage is disabled or unselected.
* The first bundle is selected by default.
* Changing the WooCommerce quantity field automatically selects the matching bundle.

**Badges**

* Optional custom badge per bundle with custom text.
* Native WordPress color picker for badge color.
* Discount badges (`Save X%`) remain available alongside custom badges.

**Translations**

Custom translation files placed in `wp-content/languages/plugins/` (or `wp-content/languages/dosage-bundle-manager/`) are loaded first so they are preserved across plugin updates.

This plugin requires WooCommerce.

== Installation ==

1. Upload the `dosage-bundle-manager` folder to the `/wp-content/plugins/` directory, or install the plugin through the WordPress Plugins screen.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Ensure WooCommerce is installed and active.
4. Go to **WooCommerce → Dosage & Bundle Manager** to set the optional pills-per-day icon.
5. Edit a product, open the **Dosage & Bundles** tab, enable the dosage selector and/or bundles, and save.

== Frequently Asked Questions ==

= Does this plugin require WooCommerce? =

Yes. WooCommerce must be installed and active. The plugin will not load without it.

= Can customers buy a bundle without selecting a dosage? =

Yes. Bundles work independently. If dosage is disabled, hidden, or unselected, customers can still choose and add a bundle to the cart.

= What happens when the customer changes the product quantity? =

The plugin listens to the standard WooCommerce `input.qty` field. When the quantity matches a configured bundle quantity, that bundle becomes active and hidden form values, prices, and UI states update automatically.

= Will custom translations be overwritten on plugin update? =

No. Place compiled `.mo` (or `.l10n.php`) files in `wp-content/languages/plugins/` using the text domain `dosage-bundle-manager`. Those files are loaded before the copies bundled with the plugin.

= Can I change the color of a bundle badge? =

Yes. In the product **Dosage & Bundles** tab, enable **Custom Badge**, enter **Badge Text**, and pick a **Badge Color** with the WordPress color picker. The color is applied on the product page.

== Screenshots ==

1. Product page dosage selector and bundle cards above Add to Cart.
2. Product data tab for configuring weight ranges and bundles.
3. Custom badge text and color picker per bundle.
4. Global settings page for the pills-per-day icon.

== Changelog ==

= 1.2.1 =
* Renamed the plugin to Dosage & Bundle Manager.
* Synced WooCommerce quantity input (`input.qty`) with the matching bundle selection, including prices and hidden form fields.
* Added a WordPress color picker for custom bundle badge color on the product edit screen.
* Applied selected badge colors to frontend custom badges.
* Added a WordPress.org-compliant readme.txt.

= 1.2.0 =
* Added custom badge text for recommended/custom bundle badges without replacing discount badges.
* Decoupled bundle selection from the dosage selector.
* Added bidirectional quantity and bundle selection behavior.

= 1.1.0 =
* Added optional custom badge text per bundle.
* Selected the first bundle by default on the product page.
* Isolated the configurator widget from floating/sticky Add to Cart bars.
* Preferred global WordPress language directories for translations.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.2.1 =
Updates plugin branding to Dosage & Bundle Manager and includes quantity-to-bundle sync plus per-bundle badge colors.
