Embed Widget
The TackQuote Embed Widget
Drop a single script tag onto your storefront to add an “Add to Quote” button, a floating quote cart, and a request form — turning any product page into a B2B quote request. No backend changes required.
On this page
Overview
What the widget does
The widget is a self-contained script (no dependencies, under 8 KB minified). Once loaded on a product page, it:
- Injects an "Add to Quote" button next to your existing add-to-cart button.
- Auto-detects product name, SKU, price, and quantity from the page.
- Shows a floating action button with a live item-count badge.
- Opens a slide-out quote cart where shoppers can adjust quantities and remove items (persisted in localStorage).
- Collects Name, Company, and Email, then submits the cart as a draft quote request.
On submit, the widget POSTs the cart and buyer details to POST /v1/widget/quotes. TackQuote creates a draft quote (tagged as a storefront widget request), upserts the buyer, and notifies your sales rep. The shopper sees a confirmation with the new quote number.
/v1/widget/tack-widget.js/v1/widget/quotes/v1/widget/b2b-priceSetup
Install the script
Find your tenant ID
In the seller portal, open Integrations → Embed Widget and copy your Tenant ID — a UUID. The widget will not initialize without it.
Add the script tag before </body>
Paste this just before the closing
</body>tag, replacing the tenant ID and API URL with your own:storefront — before </body><script src="https://api.yourdomain.com/v1/widget/tack-widget.js" data-tenant-id="YOUR_TENANT_ID" data-api-url="https://api.yourdomain.com/v1" data-primary-color="#0f172a" data-button-text="Add to Quote" ></script>Publish & test
Reload a product page. You should see an Add to Quote button and a floating cart bubble. Add an item, submit the form, and confirm a new draft quote appears in your dashboard.
data-tenant-id attribute is required. If it is empty or missing, the widget skips auto-initialization entirely. It is also used to namespace the shopper's cart in localStorage (tack_quote_cart_<tenantId>).Reference
Script attributes
| Attribute | Required | Default | Purpose |
|---|---|---|---|
data-tenant-id | Yes | — | Your TackQuote tenant UUID. Sent with every quote request. |
data-api-url | Recommended | http://localhost:3001/v1 | Your TackQuote API base URL. |
data-primary-color | No | #0f172a | Accent color for the button and cart. |
data-button-text | No | Add to Quote | Label for the injected button. |
Platform
BigCommerce — Script Manager
Open Script Manager
In your BigCommerce control panel, go to Storefront → Script Manager → Create a Script.
Configure the script
- Name:
TackQuote Quote Widget - Location: Footer
- Select pages: All pages (or Product pages only)
- Script type: Script
- Name:
Paste the script tag
Paste the same
<script>tag from the install step and save. The widget auto-detects BigCommerce's add-to-cart button (button.productView-cart-addToCart).
Platform
Shopify theme
Edit your theme code
In Shopify admin, go to Online Store → Themes → ⋯ → Edit code and open
theme.liquid.Add the script before </body>
Paste the
<script>tag immediately before the closing</body>tag and save. The widget auto-detects Shopify's add-to-cart button (button[name="add"]).
Platform
Generic HTML
On a hand-built or headless storefront, add the script tag anywhere before </body>. If the widget can't auto-detect your markup, override the selectors it uses when it initializes:
window.TackWidget.init({
tenantId: 'YOUR_TENANT_ID',
apiUrl: 'https://api.yourdomain.com/v1',
addToCartSelector: '.my-add-to-cart',
productNameSelector: '.product-title',
skuSelector: '[data-sku]',
priceSelector: '.price',
qtySelector: 'input[name="quantity"]',
})Reference
JavaScript API
The widget exposes window.TackWidget for programmatic control:
| Method | Description |
|---|---|
init(options) | Initialize manually with config and selector overrides. |
addItem(item) | Add an item to the quote cart programmatically. |
open() | Open the quote cart drawer. |
close() | Close the drawer. |
getItems() | Return the current cart items. |
clearCart() | Empty the cart. |
GET /v1/widget/b2b-price endpoint returns only safe public fields (RRP, pack size, order quantities, stock status) — never negotiated or wholesale prices — so it is safe to call from a public storefront.