Getting Started

Add the main script into your page

Code
1<!-- Load SDK -->
2<script src="https://cdn.jsdelivr.net/gh/NextCommerceCo/campaign-cart@v0.3.5/dist/loader.js" type="module"></script>
3
4<!-- Campaign API Key -->
5<meta name="next-api-key" content="kLGpgEfCX3iUZG16hpI5zrCH9qxcOdahDY1im6ud"> 
6
7<!-- Next URL After order complete (normally on checkout pages) -->
8<meta name="next-next-url" content="/upsell">
9
10<meta name="next-debug" content="true">
11<meta name="next-page-type" content="product"> <!-- Can be product, checkout, upsell, receipt -->
12
13<!-- Prevent Back navigation (normally on first upsell page) -->
14<meta name="next-prevent-back-navigation" content="true">

Cart Buttons & Selectors

Action buttons & selectors are the core of the cart functionality. They work straight with attributes.

1. Swap Mode Selector (Click to replace Cart)
In swap mode, clcking a card immediately replaces the current item in a cart. No button needed.
Package Title
SAVE -
Save $0.00 + Free Shipping
-
-/ea
Total:
-
-
BEST DEAL
Package Title
SAVE -
Save $0.00 + Free Shipping
-
-/ea
Total:
-
-
Package Title
SAVE -
Save $0.00 + Free Shipping
-
-/ea
Total:
-
-
Code
1<div data-next-cart-selector data-next-selection-mode="swap">
2  <div data-next-selector-card data-next-package-id="2">...</div>
3  <div data-next-selector-card data-next-package-id="3" data-next-selected="true">...</div>
4</div>

Selection Display Feature

SELECTED PACKAGE
Title
quantity
Title
Price per unit
$19.99
total
$19.99
compare total
$19.99
SAVINGS AMOUNT
$10
SAVING PERCENTAGE
20%
Basic Selection Display
Code
1<!-- Display current selection values -->
2<span data-next-display="selection.drone-packages.total">$35.98</span>
3<span data-next-display="selection.drone-packages.name">2x Drone</span>
4<span data-next-display="selection.drone-packages.unitPrice">$17.99</span>
5<span data-next-display="selection.drone-packages.savings">$22.00</span>
Conditional Display
Code
1<!-- Show/hide based on selection properties -->
2<div data-next-show="selection.drone-packages.hasSavings">
3  You save <span data-next-display="selection.drone-packages.savingsPercentage">55%</span>!
4</div>
5
6<!-- Comparison conditions -->
7<div data-next-show="selection.drone-packages.savings > 20">
8  Big savings alert!
9</div>
Calculated Fields
Code
1<!-- Mathematical expressions -->
2<span data-next-display="selection.drone-packages.total*0.1">$3.60</span> <!-- 10% tax -->
3<span data-next-display="selection.drone-packages.total/4">$9.00</span> <!-- Split 4 ways -->
4<span data-next-display="selection.drone-packages.monthlyPrice">$3.00</span> <!-- Monthly -->
Multiple Selectors
Code
1<!-- Reference different selectors by ID -->
2<span data-next-display="selection.product-selector.name">Premium Drone</span>
3<span data-next-display="selection.color-selector.name">Midnight Black</span>
4<span data-next-display="selection.size-selector.name">Large</span>
2. Selector with Add to Cart Button
Select first, then click button to add. Button is disabled until selection is made. This selector does NOT auto-add to cart.
Package Title
SAVE -
Save $0.00 + Free Shipping
-
-/ea
Total:
-
-
BEST DEAL
Package Title
SAVE -
Save $0.00 + Free Shipping
-
-/ea
Total:
-
-
Package Title
SAVE -
Save $0.00 + Free Shipping
-
-/ea
Total:
-
-
Code
1<div data-next-cart-selector 
2     data-next-selector-id="button-selector"
3     data-next-selection-mode="select">
4  <div data-next-selector-card data-next-package-id="3">...</div>
5</div>
6
7<button data-next-action="add-to-cart" 
8        data-next-selector-id="button-selector">
9  Add to Cart
10</button>
3. Direct Add to Cart Buttons (No Selector)
Buttons that add specific packages directly without selection.
Code
1<button data-next-action="add-to-cart" 
2        data-next-package-id="2" 
3        data-next-quantity="1">
4  Add to Cart
5</button>
6
7<button data-next-action="add-to-cart" 
8        data-next-package-id="3" 
9        data-next-quantity="3"
10        data-next-url="/checkout">
11  Add & Checkout
12</button>
4. Cart Toggle Buttons (Direct Add/Remove)
Complete demonstration of toggle functionality

1. Basic Toggle Functionality

Basic Toggle
Simplest form - just data-next-toggle
Code
1<button 
2data-next-toggle 
3data-next-is-upsell="true" 
4data-next-package-id="9"> 
5Toggle Item 
6</button>
Toggle with Quantity
Add specific quantity (3 units)
Code
1<button 
2data-next-toggle 
3data-next-package-id="8" 
4data-next-quantity="3"> 
5Add Extra Propeller Set
6</button>
Dynamic Text
Button text changes based on state
Code
1<button 
2data-next-toggle 
3data-next-package-id="11" 
4data-add-text="Add Extra Drone" 
5data-remove-text="✓ Extra Drone Added"> 
6Add Extra Drone 
7</button>

2. State Container Pattern

Container element receives state classes for advanced styling.
Travel Case Bundle
Container gets state classes: .next-in-cart, .next-active
Includes 2 premium travel cases
✅ Bundle is in your cart!
Code
1<div class="product-container" 
2data-next-package-id="9" 
3data-next-quantity="2"> 
4<!-- Container gets state classes --> 
5<button data-next-toggle>Toggle Bundle</button> 
6</div>

3. Quantity Sync Feature

Perfect for warranties, protection plans, and accessories that should match main product quantity.
Add the package to the cart
Package Title
Package Title
Package Title
🛡️ Extended Warranty
$2 per drone
Code
1<!-- Warranty syncs with drone quantity -->
2<button data-next-toggle data-next-package-id="10" data-next-package-sync="2,3,4"> 
3Add Protection Plan
4</button>
5
4. Quantity Control Buttons
Buttons that add specific packages directly without selection.
1
Code
1<script>
2    const packageId = 3;
3    
4    function updateDisplay() {
5        const cartData = window.next.getCartData();
6        const item = cartData.cartLines?.find(line => line.packageId === packageId);
7        const quantity = item ? item.quantity : 0;
8        document.querySelector('[quantity="display"] div').textContent = quantity;
9        
10        // Disable decrease button if quantity is 1 or less
11        const decreaseBtn = document.querySelector('[quantity="decrease"]');
12        if (quantity <= 1) {
13            decreaseBtn.disabled = true;
14            decreaseBtn.style.opacity = '0.5';
15            decreaseBtn.style.cursor = 'not-allowed';
16        } else {
17            decreaseBtn.disabled = false;
18            decreaseBtn.style.opacity = '1';
19            decreaseBtn.style.cursor = 'pointer';
20        }
21    }
22
23    document.querySelector('[quantity="decrease"]').addEventListener('click', function() {
24        const cartData = window.next.getCartData();
25        const item = cartData.cartLines?.find(line => line.packageId === packageId);
26        if (item && item.quantity > 1) {
27            window.next.updateQuantity({ packageId: packageId, quantity: item.quantity - 1 });
28            setTimeout(updateDisplay, 100);
29        }
30    });
31
32    document.querySelector('[quantity="increase"]').addEventListener('click', function() {
33        const cartData = window.next.getCartData();
34        const item = cartData.cartLines?.find(line => line.packageId === packageId);
35        const currentQuantity = item ? item.quantity : 0;
36        window.next.updateQuantity({ packageId: packageId, quantity: currentQuantity + 1 });
37        setTimeout(updateDisplay, 100);
38    });
39
40    updateDisplay();
41    
42    </script>

Post Purchase

Action buttons & selectors are the core of the cart functionality. They work straight with attributes.

Code
1<!-- Load SDK -->
2<script src="https://campaign-cart-v2.pages.dev/loader.js"></script>
3
4<!-- Campaign API Key -->
5<meta name="next-api-key" content="kLGpgEfCX3iUZG16hpI5zrCH9qxcOdahDY1im6ud"> 
6
7<!-- Next URL After order complete (normally on checkout pages) -->
8<meta name="next-upsell-accept-url" content="/demo/receipt">
9<meta name="next-upsell-decline-url" content="/demo/receipt">
10
11<meta name="next-debug" content="true">
12<meta name="next-page-type" content="product"> <!-- Can be product, checkout, upsell, receipt -->
Pattern 1: Direct Upsell
Simple yes/no decision for a single item. Package ID is on the container.
🔋 Add Extra Battery Pack?
Double your flight time with an extra battery.
$39.99
$19.99
Code
1<!-- Direct mode: package ID on container -->
2<div data-next-upsell="offer" data-next-package-id="7">
3    <h3>Add Extra Battery?</h3>
4    <button data-next-upsell-action="add">Yes</button>
5    <button data-next-upsell-action="skip">No</button>
6</div>
Pattern 2: Upsell with Selection (Cards)
Multiple options to choose from. Uses selector ID instead of package ID.
Premier
  • PRESSURE-RELIEVING
  • OTHER BENEFIT
Premier
  • PRESSURE-RELIEVING
  • OTHER BENEFIT
Code
1<!-- Selector mode: uses selector ID -->
2<div data-next-upsell-selector data-next-selector-id="protection">
3    <div data-next-upsell-option data-next-package-id="7">
4        Basic - $14.99
5    </div>
6    <div data-next-upsell-option data-next-package-id="9" data-next-selected="true">
7        Premium - $24.99
8    </div>
9    <button data-next-upsell-action="add">
10        Add Selected
11    </button>
12</div>
Pattern 3: Upsell with Selection (Dropdown)
Native select element for compact UI. Just add the attributes!
Code
1<!-- Wrap in upsell container -->
2<div data-next-upsell-selector data-next-selector-id="training">
3    <select data-next-upsell-select="training">
4        <option value="">Choose...</option>
5        <option value="2">Beginner - $29.99</option>
6        <option value="3" selected>Advanced - $49.99</option>
7    </select>
8    
9    <button data-next-upsell-action="add">
10        Add Course
11    </button>
12</div>
Pattern 4: Upsell with Quantity Controls
Simple quantity selector for bulk purchases.
🔋 Add Extra Battery Pack?
Double your flight time with an extra battery.
$39.99
$19.99
1
Code
1<!-- Quantity controls -->
2<div data-next-upsell="offer" data-next-package-id="7">
3    <button data-next-upsell-quantity="decrease">-</button>
4    <span data-next-upsell-quantity="display">1</span>
5    <button data-next-upsell-quantity="increase">+</button>
6    
7    <button data-next-upsell-action="add">Add to Order</button>
8</div>
Pattern 5: Quantity Toggle Cards
Click to select quantity - perfect for bundles!
🔋 Add Extra Battery Pack?
Double your flight time with an extra battery.
$39.99
$19.99
1
2
3
4
Code
1<!-- Quantity toggle cards -->
2<div data-next-upsell="offer" data-next-package-id="7">
3    <div data-next-upsell-quantity-toggle="1">1 Pack</div>
4    <div data-next-upsell-quantity-toggle="2">2 Pack</div>
5    <div data-next-upsell-quantity-toggle="4">4 Pack</div>
6    
7    <button data-next-upsell-action="add">
8        Add <span data-next-upsell-quantity="display">1</span> to Order
9    </button>
10</div>

Attributes

Attributes are utilities that can be used to render content dynamically

Campaign Attributes
Description
data-next-display="campaign.name"
{Campaign Name}
data-next-display="campaign.currency"
{Campaign Currency}
data-next-display="campaign.language"
{Campaign Language}
📦 Package Attributes
Display package/product data with context awareness. These work within package context (e.g., inside selector cards).

You can also use package context for example package.X.name

These examples have the data-next-package-id on this parent container.

📋 Basic Package Properties

data-next-display="package.name"
Package name
----------
data-next-display="package.image"
Package image URL
----------
data-next-display="package.qty"
Number of units in package
----------
data-next-display="package.is_recurring"
If package is recurring
----------
data-next-display="package.interval"
Recurring interval frequency
----------

💰 Pricing Properties

data-next-display="package.price"
Per-unit price (formatted)
----------
data-next-display="package.price_total"
Total package price (formatted)
----------
data-next-display="package.price_retail"
Per-unit retail price (formatted)
----------
data-next-display="package.price_retail_total"
Total retail price (formatted)
----------
data-next-display="package.unitPrice"
 Same as package.price (alias)
----------
data-next-display="package.packageTotal"
Same as package.price_total (alias)
----------

🎯 Calculated Fields

data-next-display="package.savingsAmount"
Retail savings only (no discounts)
----------
data-next-display="package.totalSavingsAmount"
Combined (retail + discount)
----------
data-next-display="package.savingsPercentage"
Savings percentage (formatted)
----------
data-next-display="package.totalSavingsPercentage"
Combined percentage (retail + discounts)
----------
data-next-display="package.unitSavings"
Per-unit savings amount
----------
data-next-display="package.unitSavingsPercentage"
Per-unit savings percentage
----------
data-next-display="package.unitRetailPrice"
Per-unit retail price
----------
data-next-display="package.finalPrice"
Unit price after discounts
----------
data-next-display="package.finalPriceTotal"
Total price after discounts
----------
data-next-display="package.discountAmount"
 Amount saved from discount codes
----------

✅ Boolean Properties (for conditionals)

data-next-show="package.hasSavings"
Show if package has savings
This package has savings
data-next-show="package.hasRetailPrice"
Show if retail price exists
This package has retail
data-next-show="package.isBundle"
Show if qty > 1
This package is a bundle
data-next-show="package.isRecurring"
Show if subscription
This package is a subscription
data-next-show="package.isOneTime"
Show if one-time purchase
This package is a one time order

🔢 Raw Values (unformatted)

data-next-display="package.price.raw"
Raw price value
----------
data-next-display="package.savingsAmount.raw"
Raw savings amount
----------
data-next-display="package.savingsPercentage.raw"
Raw savings percentage
----------
data-next-display="package.unitPrice.raw"
Raw unit price
----------
🎯 Selection Attributes
Display data based on currently selected package in a selector. Updates when selection changes.

📋 Basic Selection Properties

data-next-display="selection.{selectorId}.name"
Selected package name
----------
data-next-display="selection.{selectorId}.packageId"
Selected package ID
----------
data-next-display="selection.{selectorId}.quantity"
Selected quantity
----------
data-next-display="selection.{selectorId}.hasSelection"
Whether something is selected
----------

💰 Selection Pricing

data-next-display="selection.{selectorId}.price"
Unit price of selection
----------
data-next-display="selection.{selectorId}.total"
Total price of selection
----------
data-next-display="selection.{selectorId}.compareTotal"
Compare/retail total
----------
data-next-display="selection.{selectorId}.unitPrice"
Price per unit
----------

🎯 Selection Calculated Fields

data-next-display="selection.{selectorId}.savingsAmount"
Total savings
----------
data-next-display="selection.{selectorId}.savingsPercentage"
Savings percentage
----------
data-next-display="selection.{selectorId}.hasSavings"
Has savings boolean
----------
data-next-display="selection.{selectorId}.isBundle"
Is multi-pack
----------
data-next-display="selection.{selectorId}.totalUnits"
Total units selected
----------

🧮 Mathematical Expressions

data-next-display="selection.{selectorId}.total*0.1"
10% of total
----------
data-next-display="selection.{selectorId}.price+5"
Price plus $5
----------
data-next-display="selection.{selectorId}.total-10"
Total minus $10
----------
data-next-display="selection.{selectorId}.total/2"
Half of total
----------
🛒 Cart Attributes
Display cart totals, quantities, and calculated values. Updates automatically when cart changes.

📊 Cart Status Properties

data-next-display="cart.isEmpty"
Whether cart is empty
----------
data-next-display="cart.hasItems"
Whether cart has items
----------
data-next-display="cart.itemCount"
Number of different items
----------
data-next-display="cart.quantity"
Total quantity of all items
----------
data-next-display="cart.count"
Same as quantity (alias)
----------
data-next-display="cart.discountCode"
Display the discount code
----------
data-next-display="cart.discountCodes"
Display the discount codes
----------
data-next-display="cart.couponCount"
Display the discount codes
----------

💰 Cart Financial Totals

data-next-display="cart.subtotal"
 Cart subtotal (formatted)
----------
data-next-display="cart.total"
 Cart total (formatted)
----------
data-next-display="cart.totalExclShipping"
Cart Total (Exclude Shipping (formatted)
----------
data-next-display="cart.shipping"
Shipping cost (formatted)
----------
data-next-display="cart.discounts"
 Discount amount (formatted)
----------
data-next-display="cart.savingsAmount"
Total savings (formatted - exclude discounts)
----------
data-next-display="cart.savingsPercentage"
 Savings percentage (formatted - exclude discounts)
----------
data-next-display="cart.totalSavingsAmount"
Total savings (formatted - include discounts)
----------
data-next-display="cart.totalSavingsPercentage"
Total savings percentage (formatted - include discounts)
----------
data-next-display="cart.compareTotal"
Compare-at total (formatted)
----------
cart.isEmpty
🛒 Cart Empty: This message shows when cart is empty
Cart Has Items: This message shows when cart has items
cart.hasItems
🚁 Drone Added: This shows only when the drone (package 2) is in cart
cart.hasItem(2)
🚁 Cart > 50: This shows only when the cart.total is more than 50
cart.total > 50
🚁 Cart >= 30 && Cart <=40 : This shows only when the cart.total is more than 30 and less than 40
cart.total >= 30 && cart.total <= 40
🚁 Cart has savings: This shows only when the cart has savings
cart.hasSavings
🚁 Cart has coupon code: -----
cart.hasCoupon
📋 Order Attributes
Display order confirmation data. Requires order ID in URL (?ref_id=ORDER_ID) or manual loading.

📋 Basic Order Properties

data-next-display="order.number"
Order number
----------
data-next-display="order.refId"
Order reference ID
----------
data-next-display="order.status"
Order status
----------
data-next-display="order.createdAt"
Order date (formatted)
----------
data-next-display="order.currency"
Order currency
----------
data-next-display="order.paymentMethod"
Payment method used
----------
data-next-display="order.shippingMethod"
Shipping  method used
----------

💰 Order Financial Data

data-next-display="order.total"
Order total including tax (formatted)
----------
data-next-display="order.subtotal"
Order subtotal excluding tax (formatted)
----------
data-next-display="order.tax"
Tax amount (formatted)
----------
data-next-display="order.shipping"
Shipping cost including tax (formatted)
----------
data-next-display="order. shippingExclTax"
Shipping cost excluding tax (formatted)
----------
data-next-display="order.shippingTax"
Shipping tax amount (formatted)
----------
data-next-display="order.discounts"
 Discount amount (formatted)
----------

👤 Customer Information

data-next-display="order.customer.name"
 Full customer name
----------
data-next-display="order.customer.firstName"
First name only
----------
data-next-display="order.customer.lastName"
Last name only
----------
data-next-display="order.customer.email"
Customer email
----------
data-next-display="order.customer.phone"
Customer phone
----------

🏠 Address Information

data-next-display="order.shippingAddress.full"
Full shipping address
----------
data-next-display="order.shippingAddress.line1"
Address line 1
----------
data-next-display="order.shippingAddress.line2"
Address line 2
----------
data-next-display="order.shippingAddress.city"
City
----------
data-next-display="order.shippingAddress.state"
State/Province
----------
data-next-display="order.shippingAddress.country"
Country
----------
data-next-display="order.billingAddress.full"
Full billing address
----------

✅ Order Boolean Properties

data-next-show="order.isTest"
Show if test order
This is a test order
data-next-show="order.hasItems"
Show if order has items
Order has items
data-next-show="order.hasDiscounts"
Show if order has discount
Has Discounts
data-next-show="order.hasShipping"
Show if shipping charged
Has Shipping
data-next-show="order.hasTax"
Show if tax charged
Has Tax
data-next-show="order.hasUpsells"
Show if order has upsells
Has Upsells
✅ Order found!
order.exists / order.hasOrder
🎁 Order accepts additional items
order.exists / order.hasOrder
✨ Order placed less than 15 minutes ago
order.isRecent
📋 Order placed more than 15 minutes ago
order.isExpired
🎉 New order (placed < 15 min ago)
order.isNewOrder
Unable to load order. Please try again.
order.hasError
🧪 TEST ORDER - No real charges
order.isTest
🎭 Conditional Display Attributes
Show/hide elements based on conditions. Works with cart, package, selection, and order data.

👁️ Show/Hide Attributes

data-next-show="cart.hasItems"
Show when cart has items
----------
data-next-hide="cart.isEmpty"
Hide when cart is empty
----------
data-next-show="package.hasSavings"
Show when package has savings
----------
data-next-show="selection.{id}.hasSelection"
Show when selector has selection
----------

🔢 Comparison Conditions

data-next-show="cart.total > 50"
Show when cart total over $50
----------
data-next-show="cart.quantity >= 3"
Show when 3+ items in cart
----------
data-next-show="package.qty == 1"
Show for single-unit packages
----------
data-next-hide="selection.{id}.total < 20"
Hide when selection under $20
----------

🎯 Advanced Conditionals

data-next-show="cart.savingsPercentage > 30"
Show when savings over 30%
----------
data-next-show="package.isRecurring"
Show for subscription products
----------
data-next-show="selection.{id}.isBundle"
Show for multi-pack selections
----------
data-next-hide="order.hasUpsells"
Hide when order has upsells
----------
🎨 Formatting Options
Control how values are displayed with formatting attributes.

🎨 Format Types

data-format="currency"
Format as currency ($12.34)
----------
data-format="number"
Format as number (1,234.56)
----------

🎯 Conditional Hiding

data-hide-if-zero="true"
Hide element if value is 0
----------
data-hide-if-false="true"
Hide element if value is false
----------

🧮 Mathematical Transformations

data-multiply-by="2"
Multiply value by 2
----------
data-divide-by="2"
Divide value by 2
----------

Utilities

Main utilities

FOMO Script
Fomo script descriptoin
Code
1  <script>
2    // Wait for SDK to be fully initialized
3    window.addEventListener('next:initialized', function() {
4      console.log('SDK initialized, starting FOMO popups...');
5      // Simple usage - starts immediately with defaults
6      next.fomo();
7      // Optional: Listen to events for analytics
8      next.on('fomo:shown', (data) => {
9        console.log('FOMO shown:', data.customer, 'purchased', data.product);
10      });
11    });
12    // Control functions
13    function startFomo() {
14      next.fomo({
15        initialDelay: 2000, // Start after 2 seconds
16        displayDuration: 5000, // Show for 5 seconds
17        delayBetween: 10000 // 10 seconds between popups
18      });
19    }
20
21    function stopFomo() {
22      next.stopFomo();
23    }
24    // Custom configuration example
25    function customFomo() {
26      next.fomo({
27        items: [{
28          text: "Premium Bundle - Save 30%",
29          image: "https://example.com/premium-bundle.jpg"
30        }, {
31          text: "Starter Pack",
32          image: "https://example.com/starter-pack.jpg"
33        }],
34        customers: {
35          US: ["Sarah from Dallas", "Mike from Boston", "Lisa from Miami"],
36          CA: ["Jean from Montreal", "Pierre from Quebec", "Marie from Toronto"]
37        },
38        maxMobileShows: 3, // Show max 3 times on mobile
39        displayDuration: 4000,
40        delayBetween: 15000,
41        initialDelay: 0 // Start immediately
42      });
43    }
44  </script>
Exit intent popup
Exit intent popup
Code
1  <script>
2    // Wait for SDK to be fully initialized
3    window.addEventListener('next:initialized', function() {
4      console.log('SDK initialized, setting up exit intent...');
5      
6      // Super simple exit intent setup
7      next.exitIntent({
8        image: 'https://cdn.prod.website-files.com/68106277c04984fe676e423a/6823ba8d65474fce67152554_exit-popup1.webp',
9        action: async () => {
10          const result = await next.applyCoupon('SAVE10');
11          if (result.success) {
12            alert('Coupon applied successfully: ' + result.message);
13          } else {
14            alert('Coupon failed: ' + result.message);
15          }
16        }
17      });
18
19      // Optional: Listen to events for analytics
20      next.on('exit-intent:shown', (data) => {
21        console.log('Exit intent popup shown:', data.imageUrl);
22      });
23
24      next.on('exit-intent:clicked', (data) => {
25        console.log('Exit intent popup clicked:', data.imageUrl);
26      });
27
28      next.on('exit-intent:dismissed', (data) => {
29        console.log('Exit intent popup dismissed:', data.imageUrl);
30      });
31    });
32    
33    // Even simpler examples:
34    
35    // Just show a popup (no action)
36    function justShowPopup() {
37      next.exitIntent({
38        image: 'https://example.com/just-popup.webp'
39      });
40    }
41    
42    // Redirect instead of coupon
43    function redirectExample() {
44      next.exitIntent({
45        image: 'https://example.com/special-offer.webp',
46        action: () => {
47          window.location.href = '/special-offer';
48        }
49      });
50    }
51    
52    // Conditional popup based on cart
53    function conditionalExample() {
54      const cartCount = next.getCartCount();
55      
56      if (cartCount === 0) {
57        next.exitIntent({
58          image: 'https://example.com/empty-cart.webp',
59          action: () => window.location.href = '/products'
60        });
61      } else {
62        next.exitIntent({
63          image: 'https://example.com/discount.webp', 
64          action: () => next.applyCoupon('SAVE10')
65        });
66      }
67    }
68  </script>
Show Order Summary
$109.96
$109.96

Order Summary

Scroll for more items
FREESHIPPING
Subtotal
$0.00
Shipping
FREE
Estimated taxes
$0.70
Shipping and tax will be settled upon
checkout confirmation
Today You Saved
Discount:
$0.00
0% OFF
Grand Total:
USD
$0.00
TOTAL SAVINGS $0.00
Express Checkout
Error message
OR

Contact

Shipping

Shipping Method

Enter your shipping address to view available shipping methods.

Payment

All transactions are secure and encrypted.
Error message

Billing Address

Error message

Complete your transaction via Paypal

PayPal will open in a new tab.

Error message

After clicking “Complete Purchase”, you will be redirected to Klarna - Flexible payments to complete your purchase securely.

By clicking the button below, you agree with our Terms of Use and Privacy Policy.
30 Day Money-Back Guarantee: Feel safe knowing you're protected. Try it risk-free and return it within 30 days for a full refund or replacement—no questions asked.

Order Summary

Scroll for more items
FREESHIPPING
Subtotal
$0.00
Shipping
FREE
Estimated taxes
$0.70
Shipping and tax will be settled upon
checkout confirmation
Today You Saved
Discount:
$0.00
0% OFF
Grand Total:
USD
$0.00
TOTAL SAVINGS $0.00