Replo is a powerful landing page builder, but its default “Add to Cart” behavior redirects to the Shopify cart page. This interrupts the intended Upcart experience, which uses a slide-out drawer. With a simple JavaScript snippet, you can tell Replo to notify Upcart when a product is added, keeping the customer on the same page and opening the drawer immediately. This highlights how JavaScript can be used not only for Upcart integration but also for broader cart customization on your store.Documentation Index
Fetch the complete documentation index at: https://docs.aftersell.com/llms.txt
Use this file to discover all available pages before exploring further.
Why this integration matters
By default, Replo supports multiple post-cart behaviors:- Redirect to Shopify cart page
- Redirect to checkout
- Stay on the page (no drawer interaction)
Step 1: Open the product page in Replo
- Open your product or landing page in the Replo editor
- Select the Add to Cart button in the page layout
- In the right-hand sidebar, click the Interactions tab
kilo;p’\Step 2: Add a second interaction
- Confirm that the button already uses the Add Product to Cart interaction
- Click the
+icon under On Click - From the list of actions, select Run JavaScript
- In the code input, paste the following:
This tells Upcart to open the drawer as soon as the product is added to the cart.
Step 3: Disable Replo redirect to the cart page
- Select the Add Product to Cart interaction again
- Disable the Go to cart after? toggle
Step 4: Preview and publish
- Click Preview in Replo to test the interaction
- Add a product to the cart and confirm that the Upcart drawer opens automatically
- Once confirmed, click Publish Page to push changes live
Notes
- This setup must be applied to each page where you use Replo + Upcart together
- The
window.upcartRegisterAddToCart();function comes from Upcart’s public API and works without additional code installations - This works for both mobile and desktop versions of Replo pages