=== eCommerce Wishlist ===
Contributors: fahadmahmood, invoicepress
Tags: wishlist, woocommerce, ecommerce, favorites, save for later
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Fast, secure wishlist for your store: variations, price-drop and back-in-stock e-mails, guest lists, mini wishlist, sharing and reports. WooCommerce and EDD.

== Description ==

**eCommerce Wishlist** lets your shoppers save products for later and come back to buy them. It was rebuilt from the ground up in version 2.0 with a cart-agnostic core, so the same wishlist works across shop platforms.

**Supported shop platforms**

* WooCommerce (including HPOS and the Cart/Checkout blocks)
* Easy Digital Downloads
* Any other cart through a small adapter class (see FAQ)

**Features**

* Variation support: shoppers save the exact size or colour they want (WooCommerce variable products)
* Opt-in e-mail notifications: price drops, back in stock and wishlist reminders, with one-click unsubscribe
* Gutenberg blocks: Wishlist, Wishlist button, Mini wishlist and Wishlist count
* Wishlist count column in the WooCommerce product list and on the product edit screen
* Add to wishlist button on product pages and product lists, with flexible positions, icon/text styles and custom labels
* Works with classic WooCommerce templates and block based product grids
* Guest wishlists (stored in a cookie, merged into the account on login) or "login required" mode
* Wishlist page with price, stock status, date added, add to cart and remove
* "Add all to cart" and "Clear wishlist"
* Mini wishlist: widget, `[ecwl_mini]` shortcode and an optional floating heart with a live counter
* Shareable read-only wishlist link that customers can turn on and off
* AJAX everywhere, no page reloads, compatible with page caching
* Reports: totals and most wishlisted products, plus CSV export
* Settings page with tabs, tools and a one-click importer for wishlists created by version 1.x
* REST API (`/wp-json/ecwl/v1/items`) for headless storefronts and apps
* Developer friendly: template overrides, actions, filters and public functions
* Privacy tools: personal data export and erasure, privacy policy text
* Multisite ready and translation ready

**Premium add-on**

An optional Premium add-on adds wishlist-to-sale analytics (revenue, conversion rate, saved-but-not-sold products), guest e-mail capture with double opt-in and a restore-my-list link, and price-drop / back-in-stock alerts for guest subscribers. The free version is fully functional on its own and shows what Premium includes under **Wishlist > Settings > Go Premium**.

**Shortcodes**

* `[ecwl_wishlist]` shows the wishlist page
* `[ecwl_button id="123"]` shows the button for a product
* `[ecwl_count]` shows the number of items
* `[ecwl_mini]` shows the mini wishlist

**Security**

Every AJAX action is nonce protected, validated, rate limited and respects the guest policy. All output is escaped, all database queries are prepared, and administrative actions require the `manage_options` capability.

== Installation ==

1. Upload the plugin to `/wp-content/plugins/` or install it from the Plugins screen.
2. Activate it. A "Wishlist" page is created for you.
3. Open **Wishlist > Settings** to choose button positions, guest behaviour and the mini wishlist.
4. Optionally add the "Wishlist (mini)" widget from **Appearance > Widgets**.

== Frequently Asked Questions ==

= Does it need WooCommerce? =

It needs a supported shop plugin: WooCommerce or Easy Digital Downloads. The original "WP eCommerce" plugin is no longer supported.

= I used version 1.x. Will my customers keep their wishlists? =

Yes. Old wishlists are imported in the background after the update (or from **Wishlist > Tools**). Only products that exist on an active platform can be imported; the old data is kept as a backup.

= How do I support another cart? =

Extend `ECWL_Adapter` (see `includes/adapters/abstract-adapter.php`) and register the class with the `ecwl_adapter_classes` filter.

= How do I change the markup? =

Copy any file from the plugin's `templates` folder to `your-theme/ecwl/` and edit it.

= How do the e-mail notifications work? =

Logged-in customers tick a box on the wishlist page to opt in. Twice a day the plugin checks prices and stock of their saved items and sends one digest e-mail per customer (at most one per day). You can set the minimum price drop and a reminder delay under **Wishlist > Settings > E-mails** and send yourself a test from **Wishlist > Tools**.

= Does it work with variable products? =

Yes. On the product page the shopper chooses the options first, then taps the heart; that exact variation is saved and can be moved to the cart from the wishlist.

= Does it work with page caching? =

Yes. Buttons and counters are synchronised with the server on page load, and expired nonces are refreshed automatically. The wishlist page itself is excluded from caching.

= Which hooks are available? =

Actions: `ecwl_added`, `ecwl_removed`, `ecwl_moved_to_cart`, `ecwl_loaded`. Filters: `ecwl_settings_schema`, `ecwl_settings_tabs`, `ecwl_keep_guest_keys`, `ecwl_button_args`, `ecwl_wishlist_url`, `ecwl_template_file`, `ecwl_adapter_classes`, `ecwl_rate_limit`, `ecwl_admin_capability`, `ecwl_email_subject`, `ecwl_notify_min_interval`.

== Screenshots ==

1. Add to wishlist button on a product page
2. Wishlist page
3. Mini wishlist
4. Settings
5. Reports

== Privacy ==

Wishlist items are stored in a custom table against the user ID (logged in) or a random identifier in the `ecwl_guest` cookie (guests). Guest data is deleted automatically after the retention period you choose. If a customer opts in to wishlist e-mails, their account e-mail address is used to send them; every e-mail has an unsubscribe link. The plugin does not send data to any external service. Personal data export and erasure are supported.

== Changelog ==

= 2.2.0 =
* New: Gutenberg blocks (Wishlist, Wishlist button, Mini wishlist, Wishlist count)
* New: wishlist count column in the product list (WooCommerce and Easy Digital Downloads) and a Wishlist box on the product edit screen
* New: the settings and report screens show the plugin version and edition (Free / Pro)
* New: "Go Premium" tab listing the Premium add-on features; the Premium add-on (wishlist-to-sale analytics, guest e-mail capture, guest alerts) loads from an optional pro folder
* New: hooks for add-ons: ecwl_settings_schema, ecwl_settings_tabs, ecwl_keep_guest_keys, ecwl_guest_merged, ecwl_wishlist_after

= 2.1.0 =
* New: variation support for WooCommerce variable products (the chosen size/colour is saved, shown and added to the cart)
* New: opt-in e-mail notifications: price drops, back in stock and idle-wishlist reminders, sent as one digest with one-click unsubscribe
* New: E-mails settings tab, "Send a test e-mail" and "Run notifications now" tools
* New: REST API accepts `variation_id`; actions `ecwl_added`, `ecwl_removed` and `ecwl_moved_to_cart` receive the variation ID
* Database: wishlist table gains variation and last-seen price/stock columns (updated automatically)

= 2.0.0 =
* Complete rewrite for modern WordPress (tested up to 7.1) and PHP 7.4+
* New: WooCommerce support (HPOS and blocks compatible) and Easy Digital Downloads adapter; cart-agnostic adapter layer for other platforms
* New: guest wishlists, wishlist page, add all to cart, share link, mini wishlist (widget, shortcode, floating), REST API, reports with CSV export, tools, settings page
* New: custom database table instead of serialized user meta; automatic import of 1.x wishlists
* New: GDPR personal data exporter/eraser and privacy policy text
* Security: nonces on every action, capability checks, rate limiting, prepared queries, output escaping; no unserialize of user data
* Removed: remote request to wordpress.org on admin load, `create_function`, deprecated jQuery `.live()`, bundled premium upsell code
* Changed: text domain is now `wp-e-commerce-whish-list`; the old widget is replaced by "Wishlist (mini)"; the old WP eCommerce plugin is no longer supported

= 1.1.7 =
* Previous stable release.

== Upgrade Notice ==

= 2.2.0 =
Adds Gutenberg blocks, a wishlist count column in the product list and the optional Premium add-on hooks. No database changes.

= 2.1.0 =
Adds variation support and opt-in price-drop / back-in-stock e-mails. The database is updated automatically; back up first as usual.

= 2.0.0 =
Major rewrite: now supports WooCommerce and Easy Digital Downloads, adds many features and fixes security issues. Add the new "Wishlist (mini)" widget after updating; existing wishlists are imported automatically.
