View FAQ →

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.

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.

GET/v1/widget/tack-widget.js
POST/v1/widget/quotes
GET/v1/widget/b2b-price

Setup

Install the script

  1. 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.

  2. 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>
  3. 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.

The 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

AttributeRequiredDefaultPurpose
data-tenant-idYesYour TackQuote tenant UUID. Sent with every quote request.
data-api-urlRecommendedhttp://localhost:3001/v1Your TackQuote API base URL.
data-primary-colorNo#0f172aAccent color for the button and cart.
data-button-textNoAdd to QuoteLabel for the injected button.

Platform

BigCommerce — Script Manager

  1. Open Script Manager

    In your BigCommerce control panel, go to Storefront → Script Manager → Create a Script.

  2. Configure the script

    • Name: TackQuote Quote Widget
    • Location: Footer
    • Select pages: All pages (or Product pages only)
    • Script type: Script
  3. 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

  1. Edit your theme code

    In Shopify admin, go to Online Store → Themes → ⋯ → Edit code and open theme.liquid.

  2. 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"]).

Prefer not to touch theme code? Add the script through a custom-HTML section or a tag-manager app instead — any method that loads the script tag on product pages works.

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:

custom selectors
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:

MethodDescription
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.
The 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.