=== UpsellPress – Advanced Post purchase Upsell Widgets & Modern cart for WooCommerce ===
Contributors: dominopress
Tags: woocommerce, upsell, cross-sell, cart, checkout, discount, free gift, bundle
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Requires Plugins: woocommerce
WC requires at least: 7.0
WC tested up to: 10.8
Stable tag: 2.0.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Boost your WooCommerce sales with personalized upsells, smart discounts, free gifts, and interactive widgets — all from a beautiful drag-and-drop builder.

== Description ==

UpsellPress is a comprehensive sales-booster toolkit for WooCommerce. It allows you to create and manage powerful upsell, cross-sell, and discount widgets to increase your conversion rates and Average Order Value (AOV) — without writing a single line of code.

**Core Platform Features:**

* **Visual Widget Builder**: Fully customizable editor with live preview. Adjust colors, fonts, labels, layout, and placement in real-time.
* **Modern Slide Cart**: A high-performance side-drawer cart that integrates upsells and cross-sells directly in the cart experience.
* **Multi-Placement Support**: Show widgets on the Slide Cart (top/bottom), Before Checkout, Thank You page, After Order Table, and more.
* **Conditional Field Logic**: Widget fields show/hide dynamically based on your selections (e.g., reward type, trigger rules).
* **Grid & List Layouts**: Many widgets support a togglable Grid or List product display for maximum flexibility.
* **Fully Responsive**: Premium mobile-first design that works seamlessly with any WooCommerce theme.
* **Server-Side Cart Logic**: Discounts, free gifts, and rewards are applied server-side via dedicated PHP handlers — no coupon codes required.

== Types of Upsells Offered ==

UpsellPress includes 14 powerful, fully configurable widget templates that cover every type of upsell strategy:

---

=== 1. Frequently Bought Together (Bundling Upsell) ===

Increase AOV by suggesting curated product bundles to customers who are already in the buying mindset.

* **Explanation:** Displays a group of related products that are frequently purchased together. Customers can add the entire bundle to their cart in a single click.
* **Example:** A customer viewing a DSLR Camera is shown a bundle containing a Memory Card and a Camera Bag.
* **Customizable Options:** Heading, total price label, button text, manual/auto product selection, colors.
* **Placements:** Slide Cart, Before Checkout, Thank You page.

---

=== 2. Advanced Free Gift (Incentive Upsell) ===

Automatically offer a free gift product when a customer meets a defined cart condition.

* **Explanation:** Configure a trigger rule (minimum cart subtotal, cart quantity, or a specific product). When met, a designated gift product is displayed and can be added to the cart at $0.
* **Example:** "Spend $100 and get a free premium Beanie!" The widget shows a progress bar tracking the cart total.
* **Customizable Options:** Trigger rules, gift product, success/locked messages, progress bar, badges, colors.
* **Placements:** Slide Cart.

---

=== 3. Free Shipping Bar (Threshold Upsell) ===

Motivate customers to spend more by showing a real-time progress bar toward a free shipping threshold.

* **Explanation:** Displays the customer's progress toward a configurable spending threshold. Once reached, a success message replaces the progress indicator.
* **Example:** "You are $15 away from Free Shipping!"
* **Customizable Options:** Threshold amount, progress/success messages, colors, typography.
* **Placements:** Slide Cart.

---

=== 4. Volume Discounts / Quantity Break (Quantity Upsell) ===

Encourage customers to buy more of the same product by offering automatic, tiered quantity-based discounts.

* **Explanation:** Define quantity tiers. When a customer has the product in their cart at the required quantity, the discount is applied automatically.
* **Example:** "Buy 2 = 10% OFF, Buy 5 = 20% OFF."
* **Customizable Options:** Tiers, product selection, grid/list layout, heading.
* **Placements:** Before Checkout, Thank You page, After Order Table, Slide Cart.

---

=== 5. Smart Cross-Sell (Related Product Upsell) ===

Show hand-picked or automatically recommended products to customers as they browse the cart.

* **Explanation:** Displays up to 4 related products in either a grid or list layout. Each product has a one-click "Add to Cart" button.
* **Example:** A customer adding a laptop to the cart is recommended a wireless mouse and a laptop sleeve.
* **Customizable Options:** Product selection, layout, colors, heading.
* **Placements:** Before Checkout, Thank You page, After Order Table, Slide Cart.

---

=== 6. Mystery Product (Gamified Upsell) ===

Add gamification to the shopping experience by offering a "mystery gift" at a discounted price.

* **Explanation:** Shows a widget with a mystery box icon and a crossed-out original price. When clicked, the mystery product is added to the cart at the discounted price.
* **Example:** Offer a "Mystery Premium Accessory" for $10 instead of the usual $35.
* **Customizable Options:** Display price, actual product, button text, colors.
* **Placements:** Before Checkout, Thank You page, After Order Table, Slide Cart.

---

=== 7. Buy More Unlock (Goal-Based Upsell) ===

Incentivize customers to add more items to their cart to unlock a special reward.

* **Explanation:** Displays a progress bar tracking the number of cart items. When the target is reached, the reward (free shipping or product) is automatically applied.
* **Example:** "Add 2 more items to unlock a Free Gift!"
* **Customizable Options:** Target count, reward type, messages, suggested products.
* **Placements:** Before Checkout, Thank You page, After Order Table, Slide Cart.

---

=== 8. Build Your Own Bundle (Custom Bundle Upsell) ===

Let customers create a personalized product bundle and earn an automatic percentage discount.

* **Explanation:** Displays a selectable grid/list of products. Customers pick items, and once they reach the target count, a discount is applied.
* **Example:** "Mix and match any 3 T-shirts to get 15% off the total!"
* **Customizable Options:** Target count, discount percentage, available products, layout.
* **Placements:** Before Checkout, Thank You page, After Order Table, Slide Cart.

---

=== 9. Spend More, Save More / Tiered Discount (Order-Value Upsell) ===

Apply automatic, escalating discounts based on the cart subtotal to motivate bigger purchases.

* **Explanation:** Define multiple spending tiers. A real-time progress display shows which tier the customer is close to unlocking.
* **Example:** "Spend $50 → 10% OFF, Spend $100 → 20% OFF."
* **Customizable Options:** Tiers, messages, colors.
* **Placements:** Slide Cart.

---

=== 10. One Click Upsell (Instant Upsell) ===

Present a compelling, high-converting upsell offer that customers can accept or decline in a single click.

* **Explanation:** Displays a featured product with pricing, discount badge, and social guarantee text. The customer can add it instantly.
* **Example:** "Wait! Add this Premium Support package to your order for just $9.99 with one click."
* **Customizable Options:** Product, button text, original price toggle, guarantee text.
* **Placements:** Before Checkout, Thank You page, After Order Table, Slide Cart.

---

=== 11. Smart Recommendation (AI/Dynamic Upsell) ===

Show intelligent product recommendations based on what customers are currently buying.

* **Explanation:** Displays related products using a smart recommendation engine.
* **Example:** Display "Customers also bought" items dynamically based on the current cart contents.
* **Customizable Options:** Product selection (manual/auto), price toggle.
* **Placements:** Before Checkout, Thank You page, After Order Table, Slide Cart.

---

=== 12. Social Proof Upsell (Trust-Based Upsell) ===

Build trust and drive conversions by pairing a product upsell with real social proof metrics.

* **Explanation:** Displays a product with a star rating, customizable social proof text, and an add-to-cart button.
* **Example:** "500+ customers bought this protective case" paired with a 5-star rating.
* **Customizable Options:** Star rating, text, colors.
* **Placements:** Before Checkout, Thank You page, After Order Table, Slide Cart.

---

=== 13. Limited Stock Alert (Scarcity Upsell) ===

Create urgency by highlighting a product with a low-stock warning to push hesitant customers toward action.

* **Explanation:** Displays a product alongside a configurable stock warning message with urgent visual styling.
* **Example:** "Only 2 items left at this price! Add to cart now."
* **Customizable Options:** Stock message, remaining count, colors.
* **Placements:** Before Checkout, Thank You page, After Order Table.

---

=== 14. Complete the Setup (Complementary Upsell) ===

Suggest essential accessories or complementary products for items already in the customer's cart.

* **Explanation:** Displays curated accessory products that complete or enhance the customer's current cart items.
* **Example:** A customer buys a monitor; the widget suggests "Complete the setup with this HDMI cable."
* **Customizable Options:** Product selection, text, styling.
* **Placements:** Before Checkout, Thank You page, After Order Table, Slide Cart.

---

== Widget Placement Locations ==

| Placement Slug        | Description                                       |
|-----------------------|---------------------------------------------------|
| `slide-cart-top`      | Top of the Slide Cart drawer                      |
| `slide-cart-bottom`   | Bottom of the Slide Cart drawer                   |
| `before-thankyou`     | Before the order details on the Thank You page    |
| `thankyou`            | Directly on the Thank You page                    |
| `after-order-table`   | After the order items table on the Thank You page |

Use the shortcode `[upsellpress_widget placement="slide-cart-top"]` to embed widgets anywhere.

== Installation ==

1. Upload the `upsellpress-sales-booster` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Navigate to **UpsellPress** in the WordPress admin menu.
4. Go to **Widget Builder** to create your first widget.
5. Choose a template, configure content and styles, set placements, and activate.

== Requirements ==

* WordPress 6.0 or higher
* WooCommerce 7.0 or higher
* PHP 7.4 or higher
* Node.js (for development builds only)

== Frequently Asked Questions ==

= Does it support WooCommerce HPOS (High-Performance Order Storage)? =
Yes. UpsellPress fully declares compatibility with WooCommerce HPOS (custom order tables) and the new Cart & Checkout Blocks feature via the `FeaturesUtil::declare_compatibility()` API.

= What version of WooCommerce is required? =
WooCommerce 7.0 or higher is required. The plugin has been tested up to WooCommerce 9.9.

= Does it work with WooCommerce Cart/Checkout Blocks? =
You can use the shortcode `[upsellpress_widget placement="slug"]` within any block or page builder to embed widgets anywhere on your site.

= Can I customize widget colors and fonts? =
Yes. The built-in Widget Builder provides a visual interface to customize colors, fonts, layouts, and labels with a live preview panel.

= Are discounts applied automatically? =
Yes. Volume Discounts, Tiered Discounts, Build Bundle discounts, and Mystery Product pricing are all applied server-side by dedicated PHP handler classes — no coupon codes needed.

= Can I show widgets in the Slide Cart? =
Yes. Most widgets support `slide-cart-top` and `slide-cart-bottom` placements for seamless integration with the UpsellPress Slide Cart.

= Can I use Grid and List layouts? =
Yes. The following widgets support both Grid and List product layouts: Volume Discounts, Smart Cross-Sell, Buy More Unlock, Build Your Own Bundle.

= What happens to Buy More Unlock rewards when items are removed? =
If the customer drops below the target count, the reward (free product or free shipping) is automatically revoked on the next cart update.

== Changelog ==

= 2.0.0 =
* Added **Buy More Unlock** widget with Free Shipping and Free Product reward types.
* Added **Build Your Own Bundle** widget with server-side percentage discount handler.
* Added **Mystery Product** widget with server-side cart price override handler.
* Added server-side PHP handler classes for Volume Discounts, Tiered Discounts, Mystery Product, Buy More Unlock, and Build Bundle.
* Added Grid / List layout selector to Smart Cross-Sell, Volume Discounts, Buy More Unlock, and Build Bundle widgets.
* Added Reward Product preview to Buy More Unlock widget UI.
* Added conditional field visibility (dependency) support in config.json for all widgets.
* Added `slide-cart-top` and `slide-cart-bottom` placement support to Buy More Unlock and Build Bundle.
* Updated Mystery Product widget to dynamically display the actual product's original price (no longer hardcoded).
* Updated Reward Type field in Buy More Unlock to auto-set reward label context.
* Fixed trailing comma JSON error in QuantityBreak config.json.
* Fixed CrossSellGrid product display limit to correctly cap at 4 products.
* Fixed BuyMoreUnlock product display limit to correctly cap at 4 products.

= 1.0.0 =
* Initial release.
* Added Frequently Bought Together, Free Shipping Bar, Discount Code, and Free Gift templates.
* Integrated React-based Widget Builder with live preview.
* Redesigned Widget Builder for a more premium and fully responsive user experience.
* Overhauled Frequently Bought Together template with dynamic label and style customization.
* Implemented multi-placement support allowing widgets to appear in multiple locations.
* Enhanced Slide Cart with compact product views and support for HTML entity decoding.
* Added Quick Rename modal in Widget List with easy placement management.
* Improved Color Picker with Reset to Default button.
* Optimized build process and asset delivery for better performance.
