Populate the cart address

Updated on 12th May 2023 in Javascript SDK

If you already know your customers' address details, you may want to populate the cart automatically via the SDK. To do so, use the below example:

Shoprocket.Cart.ShippingAddress({
  email: "[email protected]",
  company_name: "Company Name",
  name: "Customer Name",
  address: "Address",
  city: "City",
  postcode: "N1 5AE",
  country: "United Kingdom",
  state: "London",
  number: "07955492093",
});
Shoprocket.Cart.BillingAddress({
  email: "[email protected]",
  company_name: "Company Name",
  name: "Customer Name",
  address: "Address",
  city: "City",
  postcode: "N1 5AE",
  country: "United Kingdom",
  state: "London",
  number: "07955492093",
});


Can’t find what you’re looking for?

Chat with us 👋

or contact us on [email protected]


as featured in