Cart Sync
Last updated
Last updated
The product detail modal default displays a Shop Now
button to navigate users to the product detail page. Cart Sync functionality enhances this experience by allowing users to add products to the cart directly in the player and increase the conversion rate. It will handle the following two scenarios:
A customer adds items to the website cart, you want to populate them in the player cart.
When the user adds an item to the player cart, you want to sync the update with the website cart.
To enable cart sync in the player, you need first to call configureCart
method to set up the cart.
Firework Shopping API onCartDisplayed
allows you to provide a list of products to display on the Firework player cart so that the player can sync with changes on the website cart. The following code sample shows how to set this up:
Firework Shopping API onCartUpdated
lets you notify the website when a user adds a product to the cart, updates the cart item quantity, or removes a cart item in the player cart.