Variable Product / Variation - Implementation Details
=====================================================

Overview
--------
Fixed the variable product variation handling on the wishlist page and added
settings to control whether individual variations can be added to the wishlist.

Changes Made
------------

1. MODIFIED: templates/wishlist-page.php
   - Added "Set Variation" button (<button class="bizzwishlist-set-variation">)
     after the variation dropdown selects in the variation selector section
   - Button is disabled by default and becomes enabled when a valid variation
     is resolved from the dropdown selections
   - When clicked, it confirms the selected variation, hides the dropdowns,
     and shows the selected variation info text instead

2. MODIFIED: assets/js/wishlist.js
   - Updated resolveVariation() function:
     * Now also finds and enables/disables the .bizzwishlist-set-variation button
     * When all attributes are selected and a matching variation is found,
       the "Set Variation" button becomes enabled
   - Added new setVariation() function:
     * Called when user clicks the "Set Variation" button
     * Reads the resolved variation ID from the hidden input
     * Collects selected attribute labels from dropdowns
     * Replaces the dropdown selector with a variation info display
     * Updates the row's data-variation-id attribute
     * Enables the "Add to Cart" button with correct variation-id
     * Updates the "Remove" button's data-variation-id
   - Added click event binding for .bizzwishlist-set-variation button

3. MODIFIED: includes/Admin/Settings.php
   - Added 'allow_variation_wishlist' to $defaults array (default: 'yes')
   - Added sanitization for the new setting in sanitize_settings()
   - Added static method: is_variation_wishlist_enabled()
   - Added new settings card "Variable Product Settings" in the admin UI
     with checkbox to enable/disable individual variation wishlist
   - Added description text explaining the setting behavior

4. MODIFIED: includes/Ajax/WishlistAjax.php
   - Updated toggle() method:
     * When allow_variation_wishlist is disabled and the product is a
       variable product, forces variation_id to 0
     * This means only the parent variable product gets added, not
       individual variations

5. MODIFIED: includes/Frontend/Assets.php
   - Added 'allow_variation_wishlist' to the localized bizzwishlist_params
     so JavaScript can check the setting value

6. MODIFIED: assets/css/wishlist.css
   - Added styles for .bizzwishlist-set-variation button
   - Added disabled state styles (.bizzwishlist-set-variation:disabled)

How It Works
-----------

Variable Product Added to Wishlist (variation_id = 0):
  - Wishlist page shows variation dropdown selects for each attribute
  - User selects attributes from dropdowns
  - JavaScript resolves the matching variation in real-time
  - "Set Variation" button becomes enabled when a valid variation is matched
  - User clicks "Set Variation" to confirm their selection
  - Dropdowns are replaced with variation info text
  - "Add to Cart" button becomes enabled with the correct variation

Specific Variation Added to Wishlist (variation_id > 0):
  - Wishlist page shows the variation info text directly
  - No dropdown selects are shown
  - "Add to Cart" button is immediately available

Setting: Allow Individual Variation Wishlist:
  - When ENABLED (default): Users can add specific variations from the
    product page. The selected variation_id is stored in the database.
    On the wishlist page, if a parent variable product has variation_id=0,
    the variation selector dropdowns and "Set Variation" button are shown.
    The "Set Variation" button becomes enabled when a valid variation is
    resolved from the selected attributes. Clicking it confirms the
    selection and enables "Add to Cart".
  - When DISABLED: The toggle AJAX handler forces variation_id to 0 for
    variable products. This means only the parent product is stored.
    On the wishlist page, the variation selector dropdowns are NOT shown.
    Instead, a "Select options on product page" link and a "Select Options"
    button are displayed, directing the user to the product page.

Update (Fix):
  - Simplified the data-variations attribute in the template to include
    only variation_id and attributes (not the full WooCommerce variation
    data). This prevents large JSON payloads that could cause parsing
    issues and fixes the "Set Variation" button not working.
  - The condition for showing the variation selector now checks the
    allow_variation_wishlist setting. When OFF, the selector is hidden.
  - When OFF, the "Add to Cart" column shows a "Select Options" link
    to the product page instead of a disabled button.
