=== Logicfire Wishlist & Registry for WooCommerce ===
Contributors: logicfire
Tags: wishlist, woocommerce, gift registry, save for later, wedding registry
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 2.1.9
WC tested up to: 10.6.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

WooCommerce wishlist and gift registry plugin — let customers save products, create wedding & baby registries, share wishlists, and buy from shared lists.

== Description ==

**The best free WooCommerce wishlist and gift registry plugin.** Let your customers save favorite products to wishlists, create gift registries for weddings, baby showers, birthdays, and holidays, and share their lists via link, email, or social media. Friends and family can view shared wishlists and purchase items directly — with real-time purchase notifications.

Lightweight, fast, and built with a modern UI. Works with WooCommerce HPOS and block themes out of the box.

**Demo:** [View Demo](https://dev.logicfire.in/)

## Features

### Wishlist Management
- **Create wishlists** — Save products to wishlists from shop, category, search, and single product pages
- **Multiple wishlists** — Create and manage multiple wishlists (configurable max; unlimited by default)
- **Guest wishlists** — Allow non-logged-in users to create wishlists via cookies
- **Add to cart from wishlist** — One-click add to cart directly from the wishlist page
- **Remove on add to cart** — Optional: remove items from wishlist when added to cart
- **Remove on purchase** — Optional: remove items when order is completed

### Gift Registry Management
- **Event dates** — Set an event date per list to use it as a registry
- **Convert to registry** — Turn a wishlist into a registry by adding an event date
- **Wishlists + Registry tabs** — Switch between wishlists and registries on the My Wishlists page
- **Purchase notifications** — Email registry owner when items are purchased from their registry

### Sharing & Visibility
- **Share wishlists** — Share via link, email, and social media (Facebook, Twitter, Pinterest)
- **Privacy controls** — Public, private, or shared visibility per wishlist
- **Invite access** — Invite specific people with view or purchase access; revoke anytime
- **Shared wishlist page** — Public URL for recipients to view (and optionally purchase from) shared lists

### Product Integration
- **Heart button on product cards** — Add-to-wishlist on shop, category, and search results
- **Single product button** — Configurable placement: after title, price, excerpt, add to cart, meta, or sharing
- **Button position** — Top left or top right on product cards
- **Compact layout** — One-tap add to default list, then change list via toast (mobile or all devices)

### Page & Shortcodes
- **Wishlist page** — Dedicated page with `[lfwlr_wishlist_registry_page]` shortcode
- **Button shortcode** — `[lfwlr_wishlist_button]` to place wishlist button anywhere
- **My Account integration** — WooCommerce My Account endpoint for wishlists

### Appearance
- **Primary & hover colors** — Customize button and heart colors
- **Border radius** — Global styling (0–32px)
- **Wishlist icon** — Heart, star, gift, or custom SVG upload
- **Registry icon** — Gift, heart, star, or custom SVG
- **Custom CSS** — Override styles for full control
- **Reset styles** — One-click restore defaults

### Email Notifications
- **Wishlist shared** — Notify recipient when someone shares a wishlist
- **Item purchased** — Email registry owner when an item is purchased from their list
- **Back in stock** — Alert users when wishlisted out-of-stock products become available
- **Configurable from** — Set email from name and address

### Technical
- **REST API** — Full REST API for wishlists and items
- **WooCommerce Blocks** — Compatible with block-based product templates
- **HPOS compatible** — Fully compatible with WooCommerce High-Performance Order Storage
- **Extensible** — Filters and hooks for developers
- **Translation-ready** — Text domain: `logicfire-wishlist-registry-for-woocommerce`

---

## Comes with Pro

Upgrade to **Wishlist & Registry for WooCommerce Pro** to unlock:

- **"I'll buy this" claims** — Let visitors claim items before purchasing to avoid duplicates
- **Claim expiry** — Configurable hours before uncompleted claims expire
- **Fulfillment tracking** — Quantity fulfilled per item; progress bars and completion handling
- **Ship to registry recipient** — Split cart: registry items ship to wishlist owner
- **Analytics dashboard** — Total wishlists, items, users, purchases, most wishlisted products, recent registry purchases
- **My Account: Registry claims** — Dedicated page for items you've claimed
- **Optional purchaser names** — Show who bought what on registries (when enabled)

---

## Requirements

- WordPress 5.8+ (tested up to 6.9)
- PHP 7.4+
- WooCommerce 6.0+ (tested up to 10.6.1)
- WooCommerce HPOS optional but supported

## Installation

1. Install and activate [WooCommerce](https://wordpress.org/plugins/woocommerce/).
2. Upload and activate **Wishlist & Registry for WooCommerce**.
3. Go to **WooCommerce → Settings → Wishlist & Registry** to configure.
4. Create a page and add `[lfwlr_wishlist_registry_page]` to use as the main wishlist page.
5. Optionally add `[lfwlr_wishlist_button]` anywhere for a standalone wishlist button.

## Shortcodes

| Shortcode                | Description                                   |
|--------------------------|-----------------------------------------------|
| `[lfwlr_wishlist_registry_page]` | Full wishlist management page with dashboard |
| `[lfwlr_wishlist_button]`    | Wishlist heart/button (works when wishlist is disabled too) |
| `[lfwlr_wishlist_counter]`   | Wishlist counter with dropdown/drawer (icon, show_label, label) |
| `[lfwlr_registry_counter]`   | Registry counter with dropdown/drawer (icon, show_label, label) |

## Gutenberg Blocks

Three blocks are available under the **"Wishlist & Registry"** category in the block editor:

- **Wishlist Button** — Add-to-wishlist button for product pages. Configure icon (heart, bookmark, star), style (icon-only, icon + text, banner), custom label, and position.
- **Wishlist Counter** — Displays a wishlist icon with item count badge. On click: dropdown on desktop, slide-in drawer on mobile — showing product names with a link to the wishlists page.
- **Registry Counter** — Same as Wishlist Counter but for gift registries. Automatically hidden when registry is disabled.

**How to use:**

1. Open the **Site Editor** (Appearance → Editor) or any page/post editor.
2. Click **+** to add a block and search for "Wishlist" or "Registry".
3. Drop the block where you want it (header, sidebar, product template, etc.).
4. Adjust settings in the right sidebar (Inspector Controls).

**Tip:** To add counters to your site header, edit your **Header template part** in the Site Editor and place the Wishlist Counter / Registry Counter blocks next to your navigation or site title.

## Elementor Widgets

If [Elementor](https://wordpress.org/plugins/elementor/) is active, three widgets appear under **WooCommerce Elements**:

- **Wishlist Button** — Same options as the Gutenberg block (icon, style, label, product ID).
- **Wishlist Counter** — Icon + badge with dropdown/drawer. Place in header templates or anywhere.
- **Registry Counter** — Icon + badge for registries. Hidden when registry is disabled.

**How to use:**

1. Edit a page or template with Elementor.
2. Search for "Wishlist" in the widget panel.
3. Drag the widget into your layout.
4. Configure icon, label, and style in the widget settings.

## Counter Widgets (Wishlist & Registry)

The counter widgets work like the WooCommerce mini-cart: a small icon with a count badge that reveals a panel with product names on click.

- **Desktop (≥768px):** Opens a dropdown panel below the icon.
- **Mobile (<768px):** Opens a slide-in drawer from the right.
- **Real-time updates:** The badge count updates instantly when items are added or removed — no page refresh needed.
- **Product list:** Shows product names with thumbnails (up to 10 items) and a "View Wishlists" or "View Registries" button at the bottom.

**Placement ideas:**

- Site header (next to cart icon and navigation)
- Sidebar widgets
- Footer
- WooCommerce My Account area

## Settings

Configure under **WooCommerce → Settings → Wishlist & Registry**:

- General: Enable/disable, guest wishlists, button positions, compact layout
- Wishlist page selection
- Remove on add to cart / remove on purchase
- Sharing: enable, email from name/address
- Appearance: colors, icons, border radius, custom CSS
- Notifications: item purchased, back in stock (item claimed and fulfillment updates with Pro)

== Changelog ==

= 2.1.7 =
* Add - Registry tab remains visible to guests on the wishlist page; guests see a short login prompt instead of registry management UI
* Fix - Gift registry requires a logged-in user: REST API blocks guest create/update of `event_date`, omits registries from guest list responses, and returns 404 for guest access to registry rows (including delete)
* Fix - Hide "Convert to registry", registry progress line, and registry-type card chrome for guests; hide registry add-to-registry control on product hearts for guests (Pro extended dashboard)
* Fix - Registry counter block, Elementor widget, and shortcode output nothing when the user is not logged in or registry is disabled (no front-end notice banner)
* Update - `wp_kses` Vue template allowlist extended for `v-bind:*` attributes where shorthand `:` is stripped

= 2.1.6 =
* Fix - Add-to-cart from shared page uses claimed quantity when a claim exists (Pro integration)
* Fix - Claim notification now respects per-user notification preference
* Add - Pro settings hooks in wishlist page Vue app for frontend dashboard settings tab

= 2.1.5 =
* Refactor - Move `LFWLR_Purchase_Tracker` out of base plugin (Pro-only ownership for fulfillment/purchase-tracking internals)
* Update - Base plugin purchase notifications remain handled by `LFWLR_Cart` + `lfwlr_item_purchased` notification flow

= 2.1.4 =
* Add - Allow selecting multiple navigation menu locations for automatic wishlist counter placement
* Fix - Counter dropdown footer behavior: keep "+X more" and "View Wishlists" pinned at the bottom while product items scroll
* Fix - Counter toggle stability in navigation: clicking the counter again now closes the same panel instead of spawning a duplicate dropdown at the top-left

= 2.1.3 =
* Add - Gutenberg blocks: Wishlist Button, Wishlist Counter, Registry Counter
* Add - Elementor widgets: Wishlist Button, Wishlist Counter, Registry Counter
* Add - Counter widgets show dropdown (desktop) or drawer (mobile) with product names and View Lists CTA
* Add - Enhanced Wishlist Button with configurable icon (heart/bookmark/star), style (icon-only/icon+text/banner), and custom label
* Add - Custom block category "Wishlist & Registry" in Gutenberg editor
* Add - Real-time badge count updates via lfwlrHooks event bus

= 2.1.2 =
* Update - Improved readme with keyword-rich description for wishlist, gift registry, wedding registry, and save for later searches
* Update - Added changelog section to readme

= 2.1.1 =
* Fix - Added parameter documentation for all function parameters
* Update - Improved code documentation and comments for better maintainability

= 2.1.0 =
* Security - Comprehensive REST API security audit - all endpoints follow WordPress.org Codex guidelines
* Fix - REST API error responses now use WP_Error instead of WP_REST_Response for proper error handling
* Fix - Added missing sanitize_callback to all REST API route arguments for input sanitization
* Fix - Added validate_callback with enum validation for visibility, access_level, and email fields
* Fix - Combined duplicate /items/{id} route registrations into single endpoint with array of handlers
* Fix - check_auth() now returns WP_Error with descriptive 401 message instead of generic false
* Refactor - Removed strict return type hints from REST methods that can return WP_Error
* Fix - Completed remaining wlr_ to lfwlr_ prefix rename across WooCommerce admin hooks, order meta keys, and transient cleanup

= 2.0.3 =
* Fix - Implement missing permission callbacks for REST API routes with proper auth closures
* Fix - Output escaping issues on wishlist frontend items via wp_kses_post and CSS inline
* Refactor - Mass rename of generic prefix wlr to unique lfwlr across all files, functions, options, and methods

= 2.0.2 =
* Update - Rename registry setting to Enable Registry and gate registry UI/API behavior behind enable_registry
* Fix - Hide/show registry tabs and frontend registry icon consistently from the new setting
* Update - Add Active state Icon color appearance setting for active icon accents
* Refactor - Normalize frontend/config naming to enableRegistry and replace legacy ww- CSS class prefixes with lfwlr-

= 2.0.1 =
* Add - Gift registry: event dates, REST event_date, fulfillment fields, Wishlists + Registry tabs, purchase tracking
* Update - extendedDashboard enabled by default for logged-in wishlist page UX

## License

GPLv2 or later. See [LICENSE](https://www.gnu.org/licenses/gpl-2.0.html).

## Author

[Logicfire](https://logicfire.in)
