To ensure the Shopify shopping cart is displayed on all pages of your Webflow site, you'll need to embed Shopify’s cart functionality globally across each page. Here's how to do it properly after integrating the “Add to Cart” button using Shopify’s Buy Button tool.
- In your Shopify admin, go to Sales Channels and click the “Buy Button”.
- Choose the product or collection, then generate the Add to Cart button.
- Shopify will provide you with two sets of embedded scripts: one for the product/button and one for the cart widget.
2. Use the Cart Script on All Pages
- The cart script needs to be present on all pages where you want the cart display and interactivity.
- Copy the cart embed script (the part that initializes the Shopify cart UI, usually at the bottom of the code).
- In Webflow, go to Project Settings > Custom Code > Footer Code and paste the cart script there. This injects the cart code into every page of your site.
- Paste only the Add to Cart button portion of the script on specific pages or elements.
- You can do this using a Webflow Embed element (Add panel > Components > Embed).
- Place the embed where you want the “Add to Cart” button to appear.
4. Make Sure the Cart Icon or Modal is Visible
- By default, the Shopify Buy Button script includes a floating cart button that appears once an item is added.
- You can customize its position and style directly in the Buy Button editor in Shopify before copying the embed code.
5. Test On Multiple Pages
- Publish your Webflow site and test by navigating between pages.
- Add items to the cart and verify the cart persists (Shopify stores cart items in localStorage by default).
- Ensure the cart UI appears consistently across the site.
Summary
To show the Shopify shopping cart on all pages of your Webflow site, embed the Shopify cart script into your site’s global footer code. This ensures the cart functionality is loaded on every page, while individual Add to Cart buttons can be placed only where needed.