Overview
If you want a cleaner first impression or your homepage layout conflicts with the sticky cart button, you can hide the button specifically on the homepage using a simple code snippet. This setup checks the customer’s current page and removes the sticky cart button if they are on the homepage.When to use this
- To avoid visual clutter on your homepage
- When using a custom hero section or layout that overlaps with the sticky cart
- To keep the cart button focused on product pages or collections
Step 1: Add the script
- Go to Upcart > Cart Editor > Settings > Custom HTML
- From the HTML Location dropdown, select Scripts (Before Load)
- Paste the following JavaScript:
Step 2: Add custom CSS
- Go to Upcart > Sticky Cart > Custom CSS (note that this is Sticky Cart, not Cart Editor)
- Paste the following CSS:
Final result
- The sticky cart button will be hidden when a customer visits the homepage (
/or/[locale]) - The button remains visible on all other pages

