=== ITG Filter Easy ===
Contributors: itgwp
Tags: woocommerce, filter, elementor, ajax, product filter
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.7.6
License: GPL-3.0-or-later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

WooCommerce product filter Elementor widget with AJAX support. Filters the existing catalog output without page reload.

== Description ==

ITG Filter Easy is an Elementor widget for WooCommerce product filtering. It works as a **sidebar filter** — it does not output products itself, but modifies the existing WooCommerce Products widget output via URL parameters and `pre_get_posts`, with full **AJAX support** (no page reload).

**Key features:**

* Filter by categories, attributes (pa_*), price range, brand, stock status, sale, and text search
* AJAX update — product list refreshes without page reload
* Faceted counts — option counts update after each filter change
* Browser history support — Back / Forward navigation works correctly
* Brand currency conversion — prices stored in brand currency are auto-converted to the WooCommerce active currency using a configurable exchange rate feed
* Auto-filter mode — applies filters instantly on change without a submit button
* 5 translations bundled: Russian, German, French, Spanish, Chinese
* 16 developer filter hooks
* HPOS (High-Performance Order Storage) compatible

== 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.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.
