(add-ecommerce-item! sku
&
{:keys [name category price quantity]
:or {price 0 quantity 1}})Add a product to the tracked cart.
sku is required. Options: :name — product name (string) :category — product category or vector of categories :price — unit price (default 0) :quantity — quantity (default 1)
Call track-ecommerce-cart-update! after modifying the cart.
Add a product to the tracked cart. sku is required. Options: :name — product name (string) :category — product category or vector of categories :price — unit price (default 0) :quantity — quantity (default 1) Call track-ecommerce-cart-update! after modifying the cart.
(clear-ecommerce-cart!)Remove all items from the tracked cart. Call track-ecommerce-cart-update! after clearing.
Remove all items from the tracked cart. Call track-ecommerce-cart-update! after clearing.
(get-ecommerce-items! callback)Async: retrieve current cart contents as a ClojureScript structure. Calls (callback items-map).
Async: retrieve current cart contents as a ClojureScript structure. Calls (callback items-map).
(remove-ecommerce-item! sku)Remove a product from the tracked cart by SKU. Call track-ecommerce-cart-update! after modifying the cart.
Remove a product from the tracked cart by SKU. Call track-ecommerce-cart-update! after modifying the cart.
(track-ecommerce-cart-update! grand-total)Record the current cart state. Call this after any add/remove/clear operation. grand-total: current total value of the cart.
Record the current cart state. Call this after any add/remove/clear operation. grand-total: current total value of the cart.
(track-ecommerce-order! order-id
grand-total
&
{:keys [sub-total tax shipping discount]})Track a completed purchase.
order-id and grand-total are required. Options: :sub-total — subtotal before tax/shipping :tax — tax amount :shipping — shipping cost :discount — discount amount
Track a completed purchase. order-id and grand-total are required. Options: :sub-total — subtotal before tax/shipping :tax — tax amount :shipping — shipping cost :discount — discount amount
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |