=== SkyNet Smart Favorites ===
Contributors: satinath1
Donate link: https://skynetsol.com/skynet-smart-favorites.html
Tags: wishlist for woocommerce, woocommerce add to wishlist, save for later, wishlist, woocommerce wishlist
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
WC requires at least: 8.0
WC tested up to: 10.7
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A fast WooCommerce wishlist plugin with multiple lists, guest favorites, AJAX add to cart, a wishlist page, and a header favorites icon.

== Description ==

**SkyNet Smart Favorites** is a **wishlist for WooCommerce** that lets shoppers save products as favorites, organize them into **multiple wishlists**, and **add to cart** from the list—without full page reloads. It is built for WooCommerce stores that want a clean, lightweight alternative to heavy wishlist suites.

Use it to improve product discovery, reduce abandoned browsing, and give customers a simple **save for later** flow on the shop catalog, single product pages, and a dedicated **wishlist page**.

= Why stores use this WooCommerce wishlist plugin =

* **Built for WooCommerce** — Uses WooCommerce sessions, cart APIs, and product data (not a generic post-only list).
* **Guest and logged-in shoppers** — Visitors can save favorites immediately; lists are stored in the WooCommerce customer session for guests and logged-in customers.
* **Merchant-friendly setup** — Tabbed admin **Settings**, **Button Customizer**, and **Tools**, sensible defaults, and an auto-created wishlist page.
* **Modern storefront** — AJAX actions, optional toast notifications, Gutenberg block, and shortcodes for flexible placement.
* **Marketplace-ready foundations** — HPOS compatible, Cart/Checkout blocks declared, prepared SQL, and rate-limited AJAX.

= Shopper experience (storefront) =

**Add to wishlist on shop and product pages**

* Show a **button**, **icon**, or **icon + text** control on the **product loop** (shop, categories, archives) and on the **single product** page.
* Choose **position** on loops and single products: before or after add to cart, or over the product image (over image works best with **Icon only** on shop/category grids).
* **AJAX add and remove** on the shop catalog and product pages (no full page reload).
* Optional **toast or tooltip** feedback when a product is added or removed from favorites.

**Multiple wishlists**

* Let customers create **named wishlists** (not only a single default list).
* Control how new items are saved: always use the default list, use the **last-used list**, or **ask which list** each time (when multiple lists are enabled).
* **Rename** or **delete** lists from the wishlist page (except the default list).

**Guest wishlist**

* **Guest wishlist** data is stored in the **WooCommerce customer session**, so visitors can build a list before they register or log in.
* Logged-in customers use the same session-based storage in the free plugin, so favorites persist while the session remains active.

**Wishlist page**

* Display the full wishlist with the `[skynsmfa_wishlist]` shortcode on any page (a **Wishlist** page is created on activation).
* **Table or grid layout** (Settings) shows product image, name, price, an **out-of-stock** notice when needed, **add to cart**, and remove.
* **Mobile-friendly** wishlist cards on small screens (table layout stacks into clean product cards without overlapping labels).
* Manage multiple lists from one page; **AJAX remove** items and move products to the cart row by row.

**Variable products**

* Saves the correct **variation ID** when a variable product is added, so **move to cart** uses the right options. Items saved without a variation show **Select options** on the wishlist page.

**Header favorites icon**

* **SkyNet Smart Favorites icon** — Gutenberg block plus `[skynsmfa_wishlist_menu_icon]` shortcode (enable under Settings).
* Shows a **live item counter** badge that updates over AJAX when the wishlist changes.
* Customizable icon image, link target (wishlist page), and accessibility labels.

**Shortcodes**

* `[skynsmfa_wishlist]` — Full wishlist page content (lists, products, actions).
* `[skynsmfa_wishlist_icon]` — Optional per-product add/remove control (enable under **Settings**). **Icon-only by default** (backward compatible); colors and icon style from Button Customizer.
  * `product_id` — Product ID (optional on single product templates; required elsewhere).
  * `display` — Optional: `icon` (default), `button`, `icon_text`, or `global` to match **Button type** in Button Customizer.
  * Examples: `[skynsmfa_wishlist_icon]` · `[skynsmfa_wishlist_icon product_id="123"]` · `[skynsmfa_wishlist_icon display="button"]` · `[skynsmfa_wishlist_icon product_id="123" display="global"]`
  * Separate from automatic loop/single buttons (those follow **Settings → Catalog & archives** / **Single product**).
* `[skynsmfa_wishlist_menu_icon]` — Header-style favorites link with counter.

= Admin (SkyNet Smart Favorites menu) =

**Settings**

* Enable or disable wishlist features globally.
* Toggle loop and single-product buttons; set **position** on catalog and product pages (see FAQ for over-image guidance).
* Enable the **`[skynsmfa_wishlist_icon]`** shortcode and the **header favorites icon** (block and `[skynsmfa_wishlist_menu_icon]`) independently of loop/single buttons.
* Configure **multiple wishlists** and add-to-list behavior (default list, last used, or **ask which list** with a popup).
* Choose **wishlist page layout**: **Table** (default) or **Grid** (product cards).
* Assign the **wishlist page** (must contain `[skynsmfa_wishlist]`).
* Choose **notification** style: toast, tooltip, or none.
* Adjust **AJAX rate limiting** to help protect against automated traffic.

**Button Customizer**

* **Button type** — Button with text, Icon only, or Icon + text (global default for loop and single product).
* **Built-in icons** — Heart, star, bookmark, shopping bag, tag, gift, thumbs up, and plus; or upload a **custom icon** from the Media Library.
* **Icon options** — Idle fill (outline or filled), default/hover/added colors, size (px), background shape (none, rounded square, circle), and icon position beside text (before or after) in Icon + text mode.
* **Text button options** — Background, text, and border colors for default and added states, plus corner radius.
* **Labels** — Customize add, added, and remove (accessibility) button text.
* **Custom CSS** — Optional rules validated on save and minified on the storefront.
* **Live preview** while editing appearance.

**Tools**

* **Recreate wishlist page** — Restores the default page and shortcode if it was deleted.

**Plugins screen**

* Quick **Settings** link from the WordPress Plugins list.

= Performance, data, and security =

* Wishlist lists and items are stored in the **WooCommerce customer session** (not post meta).
* **Custom database tables** are installed on activation for the plugin data foundation; **automatic upgrades** run via `dbDelta` when schema changes.
* AJAX requests use **WordPress nonces** and configurable **rate limits**.
* Scripts and styles load where needed for wishlist UI and blocks.

= WooCommerce compatibility =

* **HPOS** (High-Performance Order Storage / custom order tables) compatibility declared.
* **Cart and Checkout blocks** compatibility declared for current WooCommerce versions.
* Works with standard `wc_get_product`, session, and cart flows—no replacement of core WooCommerce templates.

= Who is this plugin for? =

* WooCommerce shops that need **multiple wishlists** and **guest support** out of the box.
* Stores that want a **fast AJAX wishlist** and a clear **favorites page** without overriding theme templates.
* Merchants using the **block editor** who want a **header favorites icon** next to cart patterns.
* Developers who prefer **hooks, blocks, and shortcodes** over editing WooCommerce template files.

= Requirements =

* [WordPress](https://wordpress.org/) 6.0 or higher
* [WooCommerce](https://woocommerce.com/) 8.0 or higher (must be active)
* PHP 7.4 or higher

== Installation ==

1. Install and activate **WooCommerce** on your site.
2. Install **SkyNet Smart Favorites** from the WordPress plugin directory (or upload the plugin folder to `/wp-content/plugins/`).
3. Activate the plugin on the **Plugins** screen.
4. Open **SkyNet Smart Favorites → Settings** and confirm **Enable wishlist features** is on.
5. Review **button placement** for shop loop and single product pages.
6. Optional: open **SkyNet Smart Favorites → Button Customizer** to set button type, icons, colors, labels, or custom CSS.
7. Visit the auto-created **Wishlist** page, or assign another page that contains `[skynsmfa_wishlist]`.
8. Optional: enable **Enable favorites menu icon** in Settings, then add the **SkyNet Smart Favorites icon** block to your header template or use `[skynsmfa_wishlist_menu_icon]` in a menu area.

== Frequently Asked Questions ==

= Is this a wishlist for WooCommerce plugin? =

Yes. **SkyNet Smart Favorites** is a WooCommerce extension. It does not work without WooCommerce. All wishlist actions use WooCommerce products, the customer session, and the cart.

= Does it support a guest wishlist? =

Yes. Guest favorites are stored in the **WooCommerce customer session** so visitors can build a list before they create an account or log in.

= Can customers create multiple wishlists? =

Yes. Enable **Allow multiple lists** under **SkyNet Smart Favorites → Settings**. Shoppers can create lists, rename them, and choose which list receives new products (depending on your **add target** setting).

= Does it work with variable products? =

Yes. The plugin stores the **variation ID** when applicable so adding to the cart from the wishlist uses the correct variation.

= Can I use a grid layout on the wishlist page? =

Yes. Under **SkyNet Smart Favorites → Settings → Layout preset**, choose **Grid**. Column count follows **WooCommerce → Settings → Products → Catalog → Products per row**.

= How do I add a wishlist button to shop and product pages? =

Enable **Show on product loop** and **Show on single product page** in **Settings**. Set **Button type** under **Button Customizer** (button with text, icon only, or icon + text) and choose position on loop and single product. No theme template edits are required.

= How do I place a wishlist control with a shortcode? =

Enable **Enable shortcode** `[skynsmfa_wishlist_icon]` under **Settings**. On a product page use `[skynsmfa_wishlist_icon]` with no ID; elsewhere pass `product_id="123"`. The shortcode is **icon-only by default** (same as releases before 1.0.3). Use `display="button"`, `display="icon_text"`, or `display="global"` to match **Button Customizer → Button type**. Colors, labels, and icon style always come from Button Customizer.

= When should I use “Over product image” on the shop loop? =

Use **Over product image** with **Icon only** on shop and category grids for a compact floating heart in the corner of the product card. For **Button with text** or **Icon + text**, use **Before add to cart** or **After add to cart** instead—the label is too wide to sit cleanly on the thumbnail.

= How do I customize button colors, icons, and labels? =

Open **SkyNet Smart Favorites → Button Customizer**. Choose **Button type** (button with text, icon only, or icon + text), pick a built-in icon or upload your own, adjust colors and size, edit labels, and optionally add **Custom CSS**. Changes apply to loop buttons, single-product buttons, and shortcode buttons that use `display="global"` (or matching display modes).

= Can I add custom CSS to wishlist buttons? =

Yes. Under **Button Customizer → Custom CSS**, add CSS rules for wishlist buttons and icons. Invalid or unsafe rules are rejected when you save; valid rules are minified and output on the storefront only when customization is enabled.

= How do I show the full wishlist page? =

Use the page created on activation (shortcode `[skynsmfa_wishlist]`) or place that shortcode on any page. Select the page under **Settings → Assigned page**.

= How do I add a favorites icon in the header? =

Enable **Enable favorites menu icon** under **Settings**. Then use the **SkyNet Smart Favorites icon** block in the site editor (search for “SkyNet” or “favorites”, or find it under WooCommerce blocks), or add the shortcode `[skynsmfa_wishlist_menu_icon]` where your theme allows blocks or shortcodes in the header.

= Does add to wishlist use AJAX? =

Yes. Shoppers can add and remove favorites via AJAX on the shop catalog, single product pages, and the wishlist page. Move to cart from the wishlist page is also AJAX. Requests use WordPress nonces and configurable rate limiting.

= Is the plugin compatible with WooCommerce HPOS? =

Yes. The plugin declares compatibility with **High-Performance Order Storage** (custom order tables).

= Does it work with WooCommerce Cart and Checkout blocks? =

Yes. **Cart/Checkout blocks** compatibility is declared for supported WooCommerce versions.

= Where is wishlist data stored? =

In the **WooCommerce customer session** for both guests and logged-in customers. The plugin also creates `skynsmfa_*` database tables on activation for its data foundation; wishlist items are not stored in post meta. Wishlist data is not sent to external SaaS services by this plugin.

= Does the plugin override WooCommerce template files? =

No. It uses hooks, shortcodes, blocks, and enqueued assets only.

= What happens when I update the plugin? =

The plugin compares the stored database version and runs **dbDelta** when needed so schema updates apply without re-activation.

== Screenshots ==

1. Admin Settings — enable wishlist, multiple lists, add target (“ask which list”), loop/single toggles, positions over product image, notifications, table/grid layout preset, assigned page, and AJAX rate limit.
2. Button Customizer — live preview plus icon style, colors, Icon + text mode, custom CSS, and labels in one tab.
3. Admin Tools — recreate the default wishlist page and `[skynsmfa_wishlist]` shortcode if it was removed.
4. Shop catalog — heart-style favorites icons over product images on the loop; filled heart shows an item already saved.
5. Single product page — floating heart icon over the main product image (icon-only mode).
6. Choose a list modal — on the shop page when “ask which list each time” is enabled; shopper picks My favorites or another list, then Add to list.
7. Wishlist page (grid layout) — multiple named lists with product cards, prices, add to cart, and remove.
8. Wishlist page (table layout) — multiple named lists with product rows, prices, add to cart, and remove.
9. SkyNet Smart Favorites icon block — live heart counter badge beside the cart in the site header.
10. Mobile wishlist — stacked product cards on a narrow screen with create/rename list, add to cart, and remove.

== Changelog ==

= 1.0.3 =
* **Added:** Dedicated **Button Customizer** admin tab — live preview plus icon style, colors, labels, and optional custom CSS.
* **Added:** Icon style (heart, star, bookmark), idle fill (outline or filled), idle/added/hover icon colors, icon size, and background shape.
* **Added:** **Custom icon upload** from the Media Library (overrides built-in icon when set).
* **Added:** Text-button background/text/border colors (idle and added) plus custom corner radius.
* **Added:** Custom **labels** for the add/added/remove favorites button.
* **Added:** **Icon + text** display mode — show an icon beside the add/added label on catalog, single product, and shortcode buttons.
* **Added:** More built-in icons — shopping bag, tag, gift, thumbs up, and plus (in addition to heart, star, and bookmark).
* **Added:** Icon position beside text (before or after) when using Icon + text mode.
* **Added:** `[skynsmfa_wishlist_icon]` optional `display` attribute — `button`, `icon_text`, or `global` (match Button Customizer); omit `display` for icon-only (same as pre-1.0.3).
* **Added:** **Custom CSS** field in Button Customizer with syntax validation on save and minified output on the storefront.
* **Fixed:** Inconsistent active (added) icon color when moving between the catalog and product page on mobile — single source of truth across loop, single, over-image, and shortcode buttons.
* **Fixed:** Idle fill (outline vs filled) now applies correctly for **Icon + text** buttons and the admin preview.
* **Fixed:** AJAX label updates for Icon + text buttons now update the text span only, preserving the icon markup.
* **Maintained:** `[skynsmfa_wishlist_icon]` icon-only default for existing shortcode placements (backward compatible).
* **Improved:** Admin guidance on **Position on loop** — over product image works best with Icon only on shop/category grids.
* **Improved:** Shortcode and FAQ documentation in readme.
* **Maintained:** HPOS and Cart/Checkout blocks compatibility declarations.

= 1.0.2 =
* **Added:** Tabbed admin hub — **Settings** and **Tools** (recreate the default wishlist page and `[skynsmfa_wishlist]` shortcode).
* **Added:** **SkyNet Smart Favorites icon** Gutenberg block and `[skynsmfa_wishlist_menu_icon]` shortcode with a live AJAX favorites counter.
* **Added:** **Grid layout** on the wishlist page in the free plugin (table layout remains the default).
* **Added:** Independent toggles to enable the per-product `[skynsmfa_wishlist_icon]` shortcode and the header favorites icon separately from loop/single buttons.
* **Improved:** **Choose a list** modal — clearer loading state and feedback while a product is added to a list.
* **Improved:** **Mobile wishlist** — table layout stacks into clean product cards on small screens (no overlapping PRICE/ACTION labels).
* **Improved:** Wishlist **table and grid** spacing, alignment, and list management on the storefront.
* **Improved:** Admin settings UX — selectable shortcodes in the settings screen and clearer storefront placement options (loop/single positions, icon-only mode).
* **Improved:** WordPress.org Plugin Check alignment — tested up to WordPress 7.0, translators comments, and readme/screenshot updates.
* **Fixed:** Mobile wishlist table labels overlapping on narrow viewports.
* **Maintained:** HPOS and Cart/Checkout blocks compatibility declarations.

= 1.0.1 =
* Added WooCommerce headers (WC requires at least, WC tested up to).
* Declared HPOS (custom_order_tables) and Cart/Checkout block compatibility via FeaturesUtil.
* Hardened uninstall.php with an ABSPATH guard.
* Refined class autoloader to use explicit paths (static-analysis file-inclusion hardening).
* Added stub languages/index.php to honor Domain Path usage.

= 1.0.0 =
* Initial release.
* Multiple wishlist support, guest session wishlists, shortcodes, move-to-cart from wishlist.

== Upgrade Notice ==

= 1.0.3 =
Button Customizer tab, Icon + text mode, custom icon upload, more icons, custom CSS, shortcode display override, and storefront/preview fixes. WooCommerce must remain active.

= 1.0.2 =
New header favorites icon block, free grid wishlist layout, Settings/Tools admin hub, and mobile wishlist card layout. WooCommerce must remain active.

== Support ==

After installation, use the [plugin support forum](https://wordpress.org/support/plugin/skynet-smart-favorites/) for questions. Please include your WordPress version, WooCommerce version, PHP version, and steps to reproduce any issue.

== License ==

This plugin is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 or later. See the plugin header for details.
