Landing Page Builder Integrations

The below code snippets outline how to trigger Cart Drawer events from your landing page builder, e.g. Replo.

The following window event will add an item to the user's cart and open the cart drawer.

window.cart.add(input:  {
  items: {
    id: number | string;
    quantity: number;
    properties?: {
      [T: string]: string;
    selling_plan?: number;
  attributes?: {
    [T: string]: string;
}, boolean)

Here's an example usage. The second parameter, set here to true, dictates whether the cart drawer will open. To add a product to the user's cart without opening the cart drawer, set the second parameter to false.

window.cart.add({ items: [{
  id: 12345678, // variant_id
  quantity: 1
}]}, true)

Last updated