=== Valabi Attribute Groups ===
Contributors: valabi
Tags: woocommerce, attributes, product attributes, attribute sets, persian
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
Stable tag: 0.4.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Define reusable groups of attributes — global and custom mixed in any order — and add a whole group to a product in one click. The "attribute sets" WooCommerce never had.

== Description ==

A laptop, phone, or accessory always needs the same handful of attributes (Brand, CPU, RAM, GPU, Screen, Storage…). Adding them one by one on every product is slow. Valabi Attribute Groups lets you define those sets once and drop a whole set onto a product's Attributes tab with a single click.

* Define named groups (e.g. Laptop, Phone, Accessory) under Products → Attribute Groups, each one a selection of your existing global attributes.
* On the product editor's Attributes tab, pick a group and click "Add group" — every attribute in it is added at once. You then just fill in the values and save.
* Built on WooCommerce's own attribute machinery (it reuses core's add-attribute request), so the rows are identical to manually-added ones and stay compatible across WooCommerce updates.
* No custom save logic, no settings bloat. Unique prefix, scoped to the right screens only — it won't clash with other plugins.

Requires global attributes to exist first (Products → Attributes). Custom per-product attributes are not templated — for product specs you want global attributes anyway, so they stay filterable in the shop.

== Installation ==

* Upload the plugin to wp-content/plugins and activate it, or install the zip from Plugins → Add New → Upload.
* Go to Products → Attribute Groups and define one group per product type.
* Edit any product, open the Attributes tab, choose a group and click "Add group".

== Changelog ==

= 0.4.2 =
* The "Save attributes" button now lights up immediately after adding a group, so you can save the attributes without a full product update. The rows are also announced to WooCommerce the same way its own "Add" button does.

= 0.4.1 =
* Fixed a 500 error when updating a product after adding a group: attribute rows now use small sequential indices instead of a timestamp, which WooCommerce's save routine could loop over billions of times.
* Fixed custom attribute rows showing as blank "New attribute" with the "Save attributes" button disabled: the name/values are now committed with a change event so WooCommerce registers them.

= 0.4.0 =
* Fully translatable: added a translation template (.pot) and a complete Persian (fa_IR) translation. Sites in Persian show Farsi; all other locales keep the English source.

= 0.3.0 =
* Groups can now mix global (taxonomy) and custom (per-product) attributes in any order — a group is an ordered, drag-to-reorder list.
* Custom attributes store a name plus optional preset values (separated by "|"); on the product they are added as custom-attribute rows with those values pre-filled.
* Existing groups from earlier versions are migrated automatically.

= 0.2.0 =
* Redesigned settings page: branded header, "how it works" guide, and an attribute picker with pills (burgundy-on-cream, RTL-safe, scoped so it never affects the rest of wp-admin).
* The product-editor control no longer pre-selects a group — it shows "— Choose a group —" and the "Add group" button stays disabled until you deliberately pick one, so an accidental click does nothing.

= 0.1.1 =
* Declared WooCommerce HPOS (custom order tables) compatibility so the plugin no longer shows under "incompatible plugins". No behaviour change — it never touches orders.

= 0.1.0 =
* Initial release: reusable global-attribute groups + one-click "Add group" button on the product Attributes tab.
* Silent daily usage telemetry (off via the VALABI_AG_TELEMETRY_OFF constant).
* Self-update support via the Valabi update hub.

== Frequently Asked Questions ==

= Does it work with custom (non-global) attributes? =
No. It only handles global attributes (Products → Attributes), which is what you want for filterable laptop/phone specs anyway.

= Will adding a group create duplicate rows if I click twice? =
It adds the group each time without de-duplicating, by design — remove any extra rows manually if needed.
