Add to cart in your store
On the Catalog and Integrated plans, customers add parts from the 3D catalog straight to your own store’s cart: Shopify, WooCommerce, BigCommerce, or any store with product links.
Set it up once under Settings → Online store in the console, then add each part’s store id to the price list. Parts with a store id get an Add to cart button; parts without one keep the parts request, so nothing is lost while you fill the ids in.
How it works#
| Where the catalog is | What Add to cart does |
|---|---|
| Embedded on your store’s own site | Puts the parts straight into the store’s cart, using the store’s own cart. No app to install, no API key. Then shows “Added to your cart” with a link to it. |
| Hosted pages (viewer, parts portal) or another site | Opens your store in a new tab with the parts in its cart. |
“Your store’s own site” means the page’s address matches the Store address you enter (with or without www.), or, for Shopify, the page is in your Shopify theme.
From the parts list customers can add several parts at once. That works everywhere on Shopify, and on WooCommerce and BigCommerce when the catalog is on the store’s own site; elsewhere, those add one part at a time.
Shopify#
- Settings → Online store: Store = Shopify, Store address = your store’s address (
https://shop.yourcompany.comorhttps://yourstore.myshopify.com). - Store id = the variant id. In Shopify admin, open a product, click its variant, and copy the number at the end of the address (
…/variants/44012345678901). A product without options still has one variant. A product export CSV includes the variant ids too. - Put the catalog on a page with a Custom Liquid section and the embed code, and send us your
myshopify.comaddress as well as your own domain.
On the store, parts are added with Shopify’s cart and the part number is written on the cart line. From hosted pages, Shopify cart links open the store with every part in the cart at once.
Each part needs to be available on the Online Store sales channel, and in stock or set to keep selling when out of stock; otherwise Shopify won’t let it into the cart.
WooCommerce#
- Store = WooCommerce, Store address = your WordPress site’s address.
- Store id = the product id, or the variation id for a product with options. Hover a product in Products to see
ID: 1234under its name.
On your site, parts go into the cart with WooCommerce’s add-to-cart, and themes that listen for it refresh their mini cart.
BigCommerce#
- Store = BigCommerce, Store address = your store’s address.
- Store id = the product id, or
product:variant(for example77:204) for a product with options.
On your store, parts are added with BigCommerce’s Storefront cart; from hosted pages the store opens with the part in its cart.
Any other store#
Store = Another store. Enter the link that adds a product to your cart, with placeholders Assembly Atlas fills in:
| Placeholder | Becomes |
|---|---|
{id} | The part’s store id from the price list |
{pn} | The part number |
{qty} | The quantity |
https://store.yourcompany.com/cart/add?sku={pn}&qty={qty}
Links add one part at a time. The store id column still has to be filled for a part to get the button; if your link only uses {pn}, put the part number in it.
For developers#
Choose Our developers handle it (embed event) for a headless store, a custom cart or a cart drawer. Nothing is opened; the embed fires atlas-add-to-cart and your code adds the parts. Call preventDefault() to tell the catalog you handled it:
document.querySelector('assembly-atlas').addEventListener('atlas-add-to-cart', async (e) => {
e.preventDefault(); // we'll add them
for (const line of e.detail.lines) {
// line = { id, qty, pn, name } id is the Store id from your price list
await myCart.add(line.id, line.qty);
}
myCart.openDrawer();
});
The same event fires on every platform before anything happens, so you can also cancel it on Shopify, WooCommerce or BigCommerce to open your theme’s cart drawer instead. After a normal add, atlas-added-to-cart fires with viewUrl, the cart page’s address.
The event option only works where the embed is on your own site. On hosted pages there’s no code of yours to receive it, so parts there fall back to the parts request.
Check it#
- Upload the price list with a store id for a few parts.
- Open a catalog on your store (not only the page builder’s preview), add a part, and check the cart.
- Open the hosted viewer link from Overview and check that the store opens with the part in its cart.
- Place a test order and check it in your store’s admin.
Add to cart clicks show up in Reports, with the parts missing a store id flagged.