Add to your shop's cart (Shopify…)

Is your builder embedded in a page of your online shop? The button becomes "Add to cart" and the bracelet is sent to your page.

If your builder is embedded in a page of your online shop (Shopify, WooCommerce, Wix…), your customer can put her bracelet straight into your cart and pay on your site, instead of sending a request by email.

WordPress + WooCommerce site? A ready-to-install plugin does everything, with no developer: see WooCommerce cart: the ready-to-install plugin.

Turn it on

  1. In Shop → Orders, tick Add the bracelet to my shop's cart.
  2. Enter your website address, for example https://www.my-shop.com (with or without www both work).
  3. Save, then ask your developer to add the small script below to the page that holds the builder.

On your page, the order button becomes Add to cart. Elsewhere (direct link to the builder, another site), the email order stays in place.

The bracelet is only sent to your website's address, never to another one.

What your page receives

On click, the builder sends a message to your page (postMessage):

  • total, currency: the total price and the currency;
  • wrist_cm, bead_mm, real_length_cm: requested wrist size, bead size (a list, for example [8, 10], when sizes are mixed), actual length;
  • beads and elements: the list, with name, qty and unit_price (plus length_mm for elements, size_mm for each stone: one line per stone and size);
  • order_text: the composition as text, ready for an order note;
  • design_url: the link that reopens exactly this bracelet.

Unfinished bracelet: nothing is sent

The bracelet is only sent if its real length (beads, elements and clasp placed, without the empty places) is within the tolerance: from -5 mm to +8 mm around the chosen wrist size. Otherwise the builder shows "Bracelet too short…" (or "too long") and nothing is sent.

Your page can also refuse a bracelet. It then sends this message back to the builder, which shows it to your customer (as plain text) instead of "Added to cart":

document.querySelector('iframe').contentWindow.postMessage(
  { source: 'shop', type: 'bracelet:error', message: 'Your text' }, 'https://lochness-paris.com');

Your own "Add to cart" bar (optional)

In cart mode, the builder already shows the "Add to cart" button with the price (on phones, on its own line), and a bar fixed at the bottom as soon as the bracelet is complete. If you prefer to show your own bar on your page, at the bottom of the phone screen, two messages are available.

Each time the bracelet changes, the builder sends to your page (only to your address):

{ source: 'lochness', type: 'bracelet:state', version: 1, filled: 24, max: 24, complete: true,
  total_cents: 3320, currency: 'EUR', length_ok: true, demo_ok: true, ready: true }

ready is true when the bracelet can be ordered (complete, right length). To get the state right away (for example when your page loads): { source: 'shop', type: 'bracelet:state?' }.

Your bar can then start the order, exactly like the builder's button (same length checks, then the usual bracelet:order message):

document.querySelector('iframe').contentWindow.postMessage(
  { source: 'shop', type: 'bracelet:checkout' }, 'https://lochness-paris.com');

For your developer (Shopify example)

window.addEventListener('message', async (e) => {
  if (e.origin !== 'https://lochness-paris.com') return;   // only the builder
  const d = e.data;
  if (!d || d.source !== 'lochness' || d.type !== 'bracelet:order') return;
  await fetch('/cart/add.js', {
    method: 'POST', headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ items: [{
      id: YOUR_BRACELET_VARIANT, quantity: 1,
      properties: { 'Composition': d.order_text, 'See the bracelet': d.design_url }
    }] })
  });
  window.location.href = '/cart';
});
Don't trust the total blindly: recompute it with your own prices (qty × your price for each stone) or check the order before shipping.

How the price is set in the cart depends on your shop (one product per price, a custom pricing app…): your developer chooses.

See also: Receiving orders, Adding the builder to your website.

Updated on November 16, 2026