=== WebDig.DEV Price From for WooCommerce ===
Contributors: webdigpt
Tags: woocommerce, variable products, product price, price from, variations
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.4.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Replace WooCommerce price ranges with a clear "From" price for variable and grouped products.

== Description ==
WebDig.DEV Price From for WooCommerce replaces the default price range (for example "€10.00 – €50.00") shown on variable and grouped products with a single "From" price, based on the cheapest option available.

**Features**

* Shows "From" followed by the lowest price on variable products whose variations have different prices.
* No confusing crossed-out price inside a "From" price. When all variations share the same price, the standard WooCommerce sale display is kept.
* Shows "From" followed by the lowest price on grouped products.
* Keeps the WooCommerce price suffix (for example "VAT included") and the store tax display settings.
* Works with standard WooCommerce shop, category and single product price displays.
* Adds the `pricefrom` CSS class to the "From" label for custom styling.
* Compatible with High-Performance Order Storage (HPOS).
* No settings required. Includes a status page under WebDig.DEV > Price From.
* Shared WebDig.DEV dashboard with cards for installed plugins.
* No telemetry, external requests or account required.

**Translations**

Included: Portuguese (Portugal), Spanish (Spain), French (France), German (Germany) and Italian (Italy). Additional translations are welcome at translate.wordpress.org.

== Installation ==
1. Upload the plugin files to the `/wp-content/plugins/woo-price-from-in-variable-products` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. WooCommerce must be installed and active.
4. No additional configuration is required. The plugin will automatically adjust price display for variable and grouped products.

== Frequently Asked Questions ==

= Does the plugin change the price charged to the customer? =
No. The plugin only changes how the price is displayed. Cart, checkout and order totals are not affected.

= How do I style the "From" label? =
Use the `.pricefrom` CSS class, for example: `.price .pricefrom { font-size: 0.85em; }`.

= Why is there no crossed-out price next to the "From" price? =
A "From" price summarises several variations, so a crossed-out regular price would mix two different prices in one line and is read awkwardly by screen readers. The sale badge still shows that the product is on sale, and the crossed-out price appears as soon as the customer selects a variation. If all variations have the same price, the regular WooCommerce sale display is used.

= Can I show the crossed-out price anyway? =
Yes. Add `add_filter( 'webdig_dev_price_from_show_sale_in_range', '__return_true' );` to your theme or a code snippets plugin. The regular price is only crossed out when every variation with the lowest price is on sale.

== Privacy ==
This plugin works locally. It does not send data to WebDig.DEV or any external service, load external assets, or create public links.

== Compatibility ==
The price filters use the WooCommerce product API and do not read or write orders. HPOS is supported. Displays that bypass WooCommerce PHP price HTML filters, including some Store API or custom block implementations, may retain their original price format.

== Screenshots ==
1. Default WooCommerce price display for variable products (before plugin activation).
2. Modified price display after activating the plugin.

== Upgrade Notice ==

= 1.4.1 =
The "From" price no longer shows a crossed-out regular price. Fixes bundled translations not being loaded.

= 1.4.0 =
Adds the WebDig.DEV dashboard and five translations. Price behavior is unchanged. No configuration is removed. Custom code using `remove_filter()` with the old `webdig_wpf_` function names must be updated to the new `webdig_dev_price_from_` names.


= 1.3.0 =
Compatibility update for WordPress 7.1 and WooCommerce 11.1. Fixes the sale price shown on variable products and a possible fatal error on grouped products.

== Changelog ==

= 1.4.1 =
* Changed: variable products with different prices now show only "From" and the lowest price, without a crossed-out regular price.
* Changed: when all variations have the same price, the default WooCommerce price display (including sale formatting) is kept.
* Added: `webdig_dev_price_from_show_sale_in_range` filter to show the crossed-out regular price next to the "From" price.
* Fixed: bundled translations in the `languages` folder were not loaded (language packs from translate.wordpress.org still take precedence).
* Fixed: the crossed-out price could appear or not depending on variation order when several variations shared the lowest price.
* Removed: unused fallback price calculation for grouped products.
* Changed: Portuguese (Portugal) label is now "A partir de".
* Changed: the Plugins screen link is now labelled "Status", as the page has no settings.
* Changed: status badges use green for active, grey for inactive and red only when WooCommerce is missing.

= 1.4.0 =
* Added the shared WebDig.DEV menu and installed-plugin dashboard.
* Added Price From status page and Settings link on the Plugins screen.
* Standardized author identity and PHP prefixes.
* Changed: PHP functions renamed from `webdig_wpf_` to `webdig_dev_price_from_`. If you used `remove_filter()` with the old names (for example `webdig_wpf_variable_price_html`), update them to the new names (for example `webdig_dev_price_from_variable_price_html`).
* Included complete Portuguese, Spanish, French, German and Italian translations.
* Preserved automatic price display, HPOS support and existing plugin identity.
* Updated compatibility target: WordPress 7.1.3 and WooCommerce 11.1.2.


= 1.3.0 =
* Tested up to WordPress 7.1 and WooCommerce 11.1.
* Fixed: the crossed-out sale price could belong to a different variation than the price shown.
* Fixed: possible fatal error on grouped products without priced children (PHP 8).
* Fixed: free (0) child products were ignored on grouped products.
* Fixed: the WooCommerce price suffix (for example "VAT included") was removed.
* Fixed: bundled translations were not loaded because of an invalid language path.
* Fixed: translated strings showed backslashes in the HTML output.
* Removed: debug messages written to the PHP error log on every page load.
* Removed: call to the deprecated `woocommerce_variable_sale_price_html` filter.
* Changed: text domain set to `woo-price-from-in-variable-products` to match the plugin slug (translate.wordpress.org).
* Changed: functions renamed with a unique `webdig_wpf_` prefix to avoid conflicts with WooCommerce.
* Changed: HTML removed from translatable strings.
* Added: `Requires Plugins: woocommerce` header.
* Added: Portuguese (Portugal) translation; updated Spanish, French and German translations.

= 1.2.5 =
* Fixed a critical issue when verifying HPOS compatibility.
* Replaced `is_enabled` method with `wc_get_feature` to check HPOS activation.
* Adjusted debug logs to prevent unnecessary errors.
* Improved compatibility checks for modern WooCommerce environments.
* Tested up to WooCommerce 9.4.3 and WordPress 6.7.1.

= 1.2.4 =
* Corrected price display issue where HTML tags were rendered as plain text.
* Replaced `esc_html__` with `__` for frontend price formatting.
* Improved handling of grouped product prices.

= 1.2.3 =
* Fixed a PHP notice related to compression (`ob_end_flush`).
* Added configuration option to disable output compression in WordPress.
* Enhanced debugging features for compatibility testing.

= 1.2.2 =
* Improved HPOS compatibility with `FeaturesUtil` declaration.
* Adjusted the code to avoid direct interactions with WooCommerce internal classes.
* Updated POT file to include new strings for compatibility logs.

= 1.2.1 =
* Added robust error handling for compatibility issues.
* Improved debugging messages for HPOS activation.
* Minor optimizations to code structure for better readability.

= 1.2.0 =
* Added compatibility with WooCommerce High-Performance Order Storage (HPOS) and Remote Logging.
* Refactored code to avoid direct interactions with `wp_postmeta` and `wp_posts`.
* Improved price display logic for grouped and variable products.
* Tested up to WordPress 6.7.1 and WooCommerce 9.4.3.
* Updated minimum PHP requirement to 7.4.
* Optimized translations and text domain handling.

= 1.1.0 =
* Updated plugin name and branding to "WebDig.DEV WooCommerce - Price From in Variable Products".
* Improved price formatting logic for variable products.
* Added compatibility with WordPress 6.7.1 and WooCommerce 9.4.3.
* Updated minimum PHP requirement to 7.4.
* Enhanced translations and text domain loading.
* Fixed minor issues in grouped product price calculations.

= 1.0.2 =
* Fixed minor bugs.
* Tested up to WordPress 6.3.1 and WooCommerce 8.1.1.

= 1.0.1 =
* Tested up to WordPress 6.3.1 and WooCommerce 8.1.1.

= 1.0.0 =
* Initial release.
* Tested up to WordPress 5.2 and WooCommerce 3.6.1.
