Overview
This customization allows you to hide specific parts of the cart, such as the rewards bar, if certain products are present. It is useful when you want to simplify the cart experience for certain SKUs or prevent specific promotions from appearing alongside certain items. This setup uses product IDs to detect which products are in the cart and hides a chosen element if a match is found. You’ll apply the logic using custom HTML and CSS in the Upcart editor.When to use this
- Hide the rewards bar when promotional items are in the cart
- Hide custom content blocks, trust badges, or upsell sections based on product type
- Maintain a cleaner or more tailored checkout flow for specific items
Step 1: Find the product IDs
- Go to Shopify Admin > Products
- Click the product you want to target
- Copy the numeric product ID from the URL after
/products/
Step 2: Add custom HTML
- Go to Upcart > Cart Editor > Settings > Custom HTML
- Paste the following code into both the Above announcements and Empty cart screen HTML sections
- Replace the values in
productIDsToExcludewith your product IDs - Update
.YOUR-CLASS-HEREto target the cart element you want to hide (for example:.upcart-rewards,.custom-message,.trust-badge)
Step 3: Optional fallback CSS
If you want to ensure the element is hidden before the cart fully loads, add this in the Custom CSS section:Final result
Once set up:- The targeted cart element (such as the rewards bar) will be hidden if the cart contains one of the specified products
- The element remains visible otherwise
- You can reuse this logic to hide or show different elements based on product-specific rules

