Install Weftwise

Most stores are live in five minutes. You paste one script tag, and optionally one line on your product template.

Before you start

You need a store key. It looks like ww_live_yourstore_… and is locked to your domain, so it's safe to put in your theme. Request a key if you don't have one.

You also need permission to edit your site's theme or add custom code.

1. Add the script

This adds the Fabric help button to every page. It opens a panel with the yardage calculator and the AI fabric expert.

<script src="https://weftwise.vercel.app/embed.js"
        data-key="YOUR_STORE_KEY" defer></script>

Place it just before the closing </body> tag. Replace YOUR_STORE_KEY with your key.

2. Platform steps

  1. In Shopify admin, go to Online Store → Themes.
  2. Duplicate your live theme first, so you can test safely. On the copy, choose ⋯ → Edit code.
  3. Open layout/theme.liquid and paste the script just above </body>. Save.
  4. Preview the copy, check the Fabric help button, then publish it.
Shopify product pages already use a quantity box named quantity, so the calculator's Set quantity button works without extra setup. If you sell by the half yard, add data-unit="half-yard".

3. Calculator on product pages

Put the calculator right under the add-to-cart button, where buyers decide how much to order:

<div data-weftwise="yardage"></div>

Shopify: open the product template in the theme editor, add a Custom Liquid block below the buy buttons, and paste the line. You can set the width from a metafield:

<div data-weftwise="yardage" data-width="{{ product.metafields.fabric.width_in }}"></div>

Without data-width, Weftwise reads the width from the listing text, such as “58/60” or “45 in wide”, and falls back to 60 inches.

Options

Add these attributes to the script tag.

AttributeWhat it doesDefault
data-keyYour store key. Required.—
data-colorBrand color for the button and panel, as a hex value.#26306b
data-labelText on the floating button.Fabric help
data-positionright or left.right
data-launcherfalse hides the floating button, so only inline calculators and your own buttons open it.true
data-unitHow your cart counts: yard, half-yard or meter.yard
data-quantity-selectorCSS selector for the quantity input to fill.input[name="quantity"]
data-widthFixed fabric width in inches for every page.read from page

Product details the expert uses

The fabric expert reads the product's name, description and Product schema from the page. Most Shopify and WooCommerce themes include these already. For the sharpest answers, make sure listings state fiber content, weight, width and stretch.

To pass details explicitly, add an element anywhere on the page:

<div hidden data-weftwise-product="95% polyester 5% spandex ITY knit, 190 GSM, 58/60 in, 4-way stretch"></div>

JavaScript API

Open the panel from your own button, or use the estimator in your own code.

Weftwise.open();           // opens on the calculator
Weftwise.open("ask");      // opens on the fabric expert
Weftwise.close();
Weftwise.refresh();        // mounts calculators added after page load
Weftwise.estimate({ garment: 10, size: 1, width: 60, repeat: 12, nap: true, qty: 1 });
// → { yards: 5, meters: 4.57, lines: [...] }

Catalog Studio

The Studio is for your team. Add a fabric photo and the supplier's title or spec sheet, and it returns a clean title, specs, product copy, tags, SEO fields, shopper FAQ and schema markup. Results export as a CSV with Shopify import columns.

Studio keys are separate from store keys and must be kept private. Don't put a Studio key in your theme.

Privacy and limits

Troubleshooting

The button doesn't appear

Check that the script tag is on the page and the key is spelled exactly. Open your browser's console and look for errors from embed.js.

The calculator shows, but there's no “Ask an expert” tab

The key isn't connected to this domain yet, or you're testing on a preview address. Send us the address you're testing on and we'll add it.

“Set quantity” doesn't appear

Weftwise didn't find a quantity box. Set data-quantity-selector to match yours.