=== ITG Filter Easy best free plugin for WooCommerce and Elementor ===
Contributors: itgwp
Tags: woocommerce, filter, elementor, ajax, product filter
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 1.7.8
License: GPL-3.0-or-later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

The best free WooCommerce product filter for Elementor. Helps customers find products instantly without refreshing the page.

== Description ==

ITG Filter Easy is the best free WooCommerce product filter widget for Elementor that makes shopping easier than ever. It works as a **sidebar filter** — it helps your customers narrow down WooCommerce products by category, price, brand, and more, all without reloading the page. Everything updates smoothly and instantly, just like on top online stores.

This is the best free WooCommerce filtering tool for any online store built with Elementor, giving you premium features at zero cost.

**Smart currency conversion with live central bank exchange rates** — as a store owner, you can enter product prices in the brand's original currency, while your customers always see prices in your store's main WooCommerce currency. ITG Filter Easy automatically converts all prices using real-time exchange rates from central banks around the world. You never have to manually update conversion rates — the plugin does it for you, ensuring accurate and fair pricing in your store's currency at all times. Perfect for stores that carry products from international brands.

Best of all — it's 100% free. No hidden fees, no premium upgrades, no subscriptions. Just a powerful filter that helps your customers find what they're looking for faster.

**Key features:**

* Filter products by categories, size, color, brand, price range, stock availability, sale items, or simple text search
* Products update instantly as customers select filters — no waiting, no page refresh
* Show live product counts next to each filter option so shoppers know what's available
* Beautiful price sliders and range selectors for a smooth shopping experience
* Smart currency conversion — if you sell products in different brand currencies, prices are automatically converted to your store's main currency
* Filters apply automatically — no need to click a "Apply" button
* Works with 5 languages out of the box: Russian, German, French, Spanish, and Chinese
* Designed to work seamlessly with most WordPress themes
* Easy to set up — just add the widget to your sidebar and you're ready to go

== What changed in this version ==

* Fixed incorrect attribute groups appearing on category pages when those terms were not actually assigned to products in the current category archive.
* Scoped faceted count queries to the current product category and active archive, preventing unrelated attributes from remaining visible in the widget.
* Improved category detection by falling back to the URL slug when the queried taxonomy object is not available yet during archive rendering.
* Hardened input sanitization and request parsing to satisfy WordPress security checks and reduce false-positive warnings.
* Cleaned up query-layer SQL handling for dynamic joins and filtered counts without changing plugin behavior.
* Removed frontend debug output and related temporary hooks used during diagnostics.
* Updated plugin metadata and readme consistency to align with Plugin Check recommendations and WordPress.org compatibility checks.

== Installation ==

1. Upload the `itg-filter-easy` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **WooCommerce → ITG Filter** to configure the filter structure and options.
4. In Elementor, drag the **ITG Filter Easy** widget into the sidebar of your shop page template.
5. In the widget settings, set the **Products selector** — the CSS selector of the WooCommerce Products widget container (default: `.elementor-widget-woocommerce-products`).

== Configuration ==

All settings are managed in **WooCommerce → ITG Filter** (not in the widget itself). The widget only exposes the `Products selector` control.

= Structure tab =

Defines which filters appear in the widget and in what order. Drag rows to reorder.

Fields: Attribute, Display type (checkbox / radio / button / select / multiselect / range), Label, Heading, Open, Count, Sort, "All" option, Items, Hint.

Built-in filter types: Category, Price, Brand, Sort by, Stock, Sale, Text search. Product attributes (pa_*) are listed automatically.

= Options tab =

Auto-filter, Hide empty, Shadow under group heading, Show hints, Group icon side, Group icon style, Brand currency, Exchange rate URL.

= Advanced tab =

Shows the current plugin version and update source URL.

== Frequently Asked Questions ==

= Does this plugin output products? =

No. It only filters the output of an existing WooCommerce Products widget placed on the same page. Add a WooCommerce Products widget to your Elementor template first, then add ITG Filter Easy to the sidebar.

= What CSS selector should I use? =

The default selector `.elementor-widget-woocommerce-products` works for most setups. If you have multiple product widgets on the page, use a more specific selector (e.g. add a custom CSS class to the widget wrapper in Elementor).

= Does it work without Elementor? =

No. The widget is built for Elementor. Elementor (free version) is required.

= Is WooCommerce required? =

Yes. WooCommerce 7.0 or later is required.

= How do I add a translation? =

Copy `languages/itg-filter-easy.pot`, translate it with Poedit, and save as `itg-filter-easy-{locale}.po`. Compile to `.mo` in the same folder.

== Developer Hooks ==

= Settings =
* `itg_flt_defaults` — Override default settings values
* `itg_flt_settings` — Filter the full settings array after loading

= Currency =
* `itg_flt_brand_currency` — Override the currency code for a brand term
* `itg_flt_pivot_rate` — Override the exchange rate for a currency code
* `itg_flt_converted_price` — Filter the final converted price
* `itg_flt_convert_price_enabled` — Disable price conversion for specific products

= Query =
* `itg_flt_allowed_orderby` — Add custom orderby values to the whitelist
* `itg_flt_sanitize_params` — Post-process sanitized filter parameters
* `itg_flt_tax_query` — Modify tax_query before it is applied to WP_Query
* `itg_flt_meta_query` — Modify meta_query before it is applied to WP_Query
* `itg_flt_filtered_counts` — Post-process the faceted term counts array

= AJAX =
* `itg_flt_ajax_query_args` — Modify WP_Query args before the AJAX product query runs
* `itg_flt_ajax_response` — Modify the AJAX JSON response before it is sent

= Price =
* `itg_flt_price_range` — Override the computed min/max price range for the slider
* `itg_flt_price_range_cache_ttl` — Change the transient cache lifetime for the price range

= Frontend =
* `itg_flt_script_data` — Add extra data to the JS object passed to the frontend script

== Screenshots ==

1. Filter widget in a WooCommerce shop page sidebar
2. Settings — Structure tab
3. Settings — Options tab
4. Settings — Help tab

== Changelog ==

= 1.7.8 =
* Added: support for category-scoped faceted counts so filters stay aligned with the current product category archive.
* Added: smarter archive detection from the current URL slug when the queried taxonomy object is not ready during page render.
* Added: improved empty-filter handling to suppress non-relevant attribute groups and keep the sidebar cleaner for customers.
* Improved: sanitization and request parsing for filter parameters used in the frontend and admin settings flow.
* Improved: query-layer stability for dynamic taxonomy joins and faceted product count calculations.
* Fixed: attribute options that were not assigned to products in the current category no longer remained visible in widget filters.

= 1.7.7 =
* Added: numeric range filters for product attributes — attributes with numeric-like terms can now render as dual-range sliders (examples: pressure, power, weight, size).
* Added: robust numeric parsing that understands both comma and dot decimal separators (12,5, 7.5, mixed formats), trims surrounding text/units, and extracts values from real-world term labels.
* Fixed: slider precision and layout for decimal ranges — dynamic step calculation ensures values like 7.5 map to the slider extremes and the selected-range fill renders correctly (price and attribute sliders now match visually).
* Fixed: slider state persistence — range values chosen by the user persist across AJAX product reloads and browser navigation (Back/Forward).
* Improved: URL & archive sync — widget now recognises external archive filters (category, brand and common tag patterns) and reflects active terms on initial page load as well as after AJAX updates.
* Improved: smart hiding of empty filters — attribute groups with 0 or 1 available options are hidden on the frontend to reduce noise; server-side faceted counts drive this behavior.
* Misc: removed debug logging from production, tightened numeric input handling, and several small frontend & query-layer bug fixes for more reliable filtering.

= 1.2.8 =
* Added: README.md and readme.txt with full documentation

= 1.2.7 =
* Moved donate block immediately after License section on Help — Overview tab

= 1.2.6 =
* Fixed: PHP syntax error in itg-flt-settings-tail.php

= 1.2.5 =
* Added: Donate block on Help — Overview tab (USDT TRC-20, clickable address, Copy button)

= 1.2.4 =
* Added: License section on Help — Overview tab (GNU GPL v2)

= 1.2.3 =
* Removed: all references to external exchange rate service
* Exchange rate URL is now fully configurable

= 1.2.2 =
* Added: GNU GPL v2 license header
* Added: Exchange rate URL setting with localization in 5 languages

= 1.2.1 =
* Fixed: download URL in auto-update info always matches the ZIP filename

= 1.2.0 =
* Fixed: ZIP compiled with forward slashes for correct extraction on Linux servers
* Fixed: nonce verified only once in update check handler

= 1.1.0 =
* Per-request in-memory cache for query, price range and sale IDs
* 5 localizations: ru_RU, fr_FR, de_DE, es_ES, zh_CN
* Settings modal: single-column layout, compact labels
* Mobile: WCAG tap targets
* 16 developer filter hooks
* All UI strings in English

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.2.8 =
Added readme.txt for WordPress.org compatibility.
