ExiusCart Developers

ExiusCart on WooCommerce

For WordPress developers and agencies working on a WooCommerce store connected to ExiusCart. Products, stock and orders sync through the WooCommerce REST API. Bundles & offers, cart add-ons, “Notify me when it’s back” and the thank-you page offer come from one small plugin: no theme files are edited.

Building your own storefront instead? See the API reference.

Works with
WooCommerce 6.0+
Plugin
One zip, v1.1.0
Events
8
Theme files edited
None
On this page
  1. 1. Switch it on
  2. 2. What ExiusCart syncs
  3. 3. The Bundle & save plugin
  4. 4. How the cart is priced
  5. 5. Cart add-ons, Notify me, thank-you offer
  6. 6. JavaScript events
  7. 7. Styling and hooks
  8. 8. Speed and safety
  9. 9. Uninstall and your data
1

Switch it on

  1. In WordPress, make a REST API key: WooCommerce › Settings › Advanced › REST API › Add key, with Read/Write permission.
  2. In ExiusCart › Channels › WooCommerce, paste the store address, Consumer key and Consumer secret.
  3. For bundles & offers: download the plugin from ExiusCart (the product editor links to it), then WordPress › Plugins › Add New › Upload Plugin and activate ExiusCart Bundle & save.
  4. In ExiusCart, open a product › Bundles & offers, add an offer and keep WooCommerce ticked under “Shows on”.

The plugin has no settings page. Offers are made and changed in ExiusCart only, and show on the store within a few minutes.

2

What ExiusCart syncs

WhatDirectionNotes
Products, images, prices, stockExiusCart → WooCommerceSent when the seller pushes a product (stock is managed by WooCommerce from then on)
OrdersWooCommerce → ExiusCartImported for fulfilment, invoices and reports; paid orders lower ExiusCart stock
ShippingExiusCart → WooCommerceThe order is marked Completed and the carrier and tracking number are added as a customer note (WooCommerce has no tracking field of its own)
Bundle kitsExiusCartEach part’s stock is taken and given back on cancel, on every channel
3

The Bundle & save plugin

One PHP file, GPLv2. Version 1.1.0 hooks into these places:

HookWhat it does
woocommerce_before_add_to_cart_formPrints the widget container above the Add to cart form, with the product id, price, currency, locale and cart URLs as data attributes
wp_enqueue_scriptsLoads offers.js on product pages only, in the footer
woocommerce_cart_calculate_feesAsks ExiusCart what the cart saves and adds one negative fee line per offer
wp_enqueue_scriptsAlso loads extras.js on every page, in the footer (cart add-ons, Notify me, thank-you offer)
woocommerce_widget_shopping_cart_before_buttons“Complete your order” box in the mini cart, above its buttons
woocommerce_after_cart_table“Complete your order” box on the cart page
woocommerce_single_product_summary“Notify me when it’s back” on sold-out products (priority 31, under the price and stock)
woocommerce_thankyouThe After payment offer on the order received page

Already on 1.0? Download the zip again from ExiusCart and upload it: WordPress replaces the old version and keeps nothing else.

Offer types

TypeIn the cart
Quantity breaks (buy 2 save 10%, buy 3 save 15%, buy 4 save 20%)The best tier reached is taken off. The widget shows a 1 / 2 / 3 / 4 item picker
Bundles (this product + others, save a %)Each whole set in the cart gets the %. A product can have several bundles: the widget shows them as one “Bundle & save” picker and adds every item of the chosen set
Buy X get YThe “get” items are discounted once the “buy” items are in the cart
Free giftBuy X get Y at 100% off

Variable products work: the widget reads the chosen variation from form.variations_form and asks the shopper to pick options first when none is chosen.

4

How the cart is priced

WooCommerce has no automatic discounts of its own, only coupons the shopper types. So on every cart calculation the plugin sends the cart lines (product id, quantity, price) to ExiusCart and adds the saving as a discount line, in the cart, the mini-cart and checkout.

DetailBehaviour
EndpointPOST /public/channel-offers/quote, rate-limited (120 calls a minute)
What is sentCart line ids, product ids, quantities and prices. No customer details, no email, no address
CachingThe same cart is answered from a 5-minute WordPress transient, so checkout stays fast
ExiusCart unreachableFull price is charged. A wrong discount is never applied
CouponsThe shopper’s own coupons keep working next to the offer line
TaxesThe fee is added without tax, like a store-wide discount
5

Cart add-ons, Notify me, thank-you offer

These are set in ExiusCart, not WordPress: open a product › Bundles & offers › In the cart or After payment (or Growth › Upsells), and keep WooCommerce ticked under “Shows on”.

FeatureWhere it showsWhat happens
Complete your orderMini cart and cart pageShows the add-ons for what is in the cart. + Add puts it in the cart over WooCommerce’s own AJAX, the mini cart refreshes, and the cart page redraws its table
Notify me when it’s backSold-out product pagesThe shopper leaves an email. When stock comes back (sent from ExiusCart or changed in WooCommerce and synced), ExiusCart’s Back in stock email goes out once, linking back to the same WooCommerce product page
After payment offerOrder received pageShows one add-on for what was just bought. Add puts it in the cart and goes straight to checkout, so the shopper pays for it with their details already filled
WooCommerce prices its own cart, so a % off set on these offers is not taken there: the add-on shows and sells at its normal price. Bundles & offers above are still discounted as usual.
Place the boxes yourself
<!-- Anywhere in a page builder layout: the script is already on every page -->
<div data-exiuscart-cart-upsell data-max-offers="2"></div>
<div data-exiuscart-notify data-product-id="123" data-available="false"
     data-title="Back soon" data-button="Email me"></div>
6

JavaScript events

All events fire on document as CustomEvents and bubble. Read the data from event.detail.

EventWhendetail
exiuscart:offers:readyThe widget has drawncount
exiuscart:offer:selectedThe shopper picks an optionoffer, option
exiuscart:offer:addedThe items are in the cartoffer, items, cart
exiuscart:offer:errorThe add failed (sold out, no option chosen)offer, error
exiuscart:upsell:openedA cart or thank-you add-on is shownoffer_id, placement, products
exiuscart:upsell:addedThe add-on is in the cartoffer_id, placement, product_id, cart
exiuscart:upsell:errorThe add-on could not be addedoffer_id, placement, message
exiuscart:notify:subscribedA shopper asked to be told when it’s backproduct_id

After adding, the widget also triggers WooCommerce’s own added_to_cart jQuery event with the cart fragments, so side carts and cart counts refresh by themselves, then goes to the cart page.

Listen in your theme
document.addEventListener('exiuscart:offer:added', function (e) {
  // e.detail = { offer, items, cart, added }  (cart = the Store API cart after the add)
  window.dataLayer && dataLayer.push({ event: 'bundle_added', offer: e.detail.offer });
});

// WooCommerce's own event fires too, so mini-carts refresh as usual
jQuery(document.body).on('added_to_cart', function () { /* open your side cart */ });

// A cart add-on was added from the mini cart or cart page
document.addEventListener('exiuscart:upsell:added', function (e) {
  // e.detail = { offer_id, placement, product_id, cart }
});

After an AJAX quick view draws a product, call window.ExiusCartOffers.refresh(). After your own side cart redraws, call window.ExiusCartExtras.refresh().

7

Styling and hooks

The widget inherits your theme’s font and text color. One CSS variable, --ec-accent, colors the selected option, the badges and the Add button. The default is #111827.

CSS
/* Every offer box carries data-exiuscart-offer="<id>" */
[data-exiuscart-offers] [data-exiuscart-offer] { font-family: var(--wp--preset--font-family--body); }

/* The options are buttons; the chosen one has aria-pressed="true" */
[data-exiuscart-offers] button[aria-pressed="true"] { box-shadow: 0 0 0 3px rgb(15 118 110 / .15); }

/* --ec-accent drives the selected border, badges and the Add button */
[data-exiuscart-offers] { --ec-accent: #0f766e; }

Cart add-ons use the classes .exc-cart-upsell, .exc-cart-upsell__item and .exc-cart-upsell__add; the Notify me box is .exc-notify. The same accent filter colors them.

PHP filter

FilterDefaultWhat it does
exiuscart_offers_accent#111827Accent color for the widget
functions.php
// functions.php (or a small plugin): match the widget to your brand color
add_filter('exiuscart_offers_accent', function () {
    return '#0f766e';
});
Want the widget somewhere else, like a page builder layout? Print your own container, and the script finds it: <div data-exiuscart-offers data-platform="woocommerce" data-store="<home url>" data-product-id="<id>" data-price="<price>" data-currency="<code>"></div>
8

Speed and safety

  • offers.js loads on product pages only, extras.js on every page; both in the footer, minified and gzipped with an ETag.
  • The cart box only asks ExiusCart about product ids in the cart. Notify me sends only the email the shopper typed and the page address.
  • Products with no offer show nothing and make no further calls.
  • The plugin stores no keys. The REST API key lives only in ExiusCart, encrypted, and is never sent to the browser.
  • Prices in the quote come from the cart itself, and the saving is worked out on ExiusCart’s server, so a shopper cannot change it.
9

Uninstall and your data

WhatOn uninstall
Bundle & save pluginDeactivate or delete it: the widget, cart saving, cart add-ons, Notify me and the thank-you offer stop at once. It saves no options, so nothing is left in the database
Notify me requestsKept in ExiusCart until the Back in stock email goes out
Cached quotesWordPress transients that expire by themselves within 5 minutes
Products sent by ExiusCartStay in WooCommerce. Delete them there if you like
REST API keyDisconnect in ExiusCart › Channels › WooCommerce, then revoke the key in WooCommerce › Settings › Advanced › REST API
Orders in ExiusCartKept for the seller’s records and invoices

Stuck on a store?

Send us the store address and what you see. A real person replies.

Contact us