How to modify what happens when pressing on Add to cart button (Vitals/Upcart app)

Topic summary

Conflict between Vitals’ Related Products “Add to cart” button and the UpCart drawer: clicking the main product Add to Cart or cart icon correctly opens the UpCart slide‑out cart, but using the Vitals section button opens the drawer and then redirects to Shopify’s default cart page.

The requester seeks a code-based solution to:

  • Redirect the Vitals button to only open the UpCart drawer, or
  • Prevent the default navigation (via JavaScript) while ensuring the item is added to the cart.

Context: A preview store URL and screenshots were provided to illustrate the Vitals related products area and the UpCart drawer (visual references; not essential to the fix).

Latest reply: A responder did not provide a code fix; instead recommended switching to a different app (iCart Cart Drawer Cart Upsell), outlining features such as a slide‑out cart, upsell/cross‑sell, customization, and real-time updates.

Outcome: No concrete solution or code guidance for Vitals + UpCart integration. The issue remains unresolved/ongoing.

Summarized with AI on December 24. AI used: gpt-5.

Hi,

I use the Vitals app for its ‘Related Products’ section on product pages, and I’ve recently installed the UpCart app to create a drawer cart page where I can add upsell products.

However, I’ve encountered an issue: When I click the main “Add to Cart” button or the cart icon, it correctly opens the UpCart drawer page. But, when I use the “Add to Cart” button in the Vitals ‘Related Products’ section, it opens the UpCart drawer AND then goes to the default Shopify cart page instead.

Is there a way to use custom code to either:

  1. Redirect the ‘Add to Cart’ button from the Vitals section to the UpCart drawer page, or
  2. Prevent Default Behavior: Use JavaScript to prevent the default behavior of opening the cart when the button is clicked. While ensuring that the item is still added to the cart without navigating away.

I hope someone can assist me with this. I look forward to your response!

Best regards,

Store URL:

https://inkly.fr/?key=9872d3f9a187a64bd0dc6e240093d0c8cf40381b4337eeb606cce11bc7f242f6&preview_theme_id=

Related Product Sections from Vitals:

UpCart Drawer:

Hello @INKLY ,

We have some recommendations that might help answer your query. Please check.

The iCart Cart Drawer Cart, Upsell Shopify app, is designed to enhance the shopping cart experience and boost sales through upselling and cross-selling. Here are some key features and benefits:

  • Cart Drawer:

    • Replaces the standard Shopify cart page with a sleek, slide-out cart drawer, providing a more interactive and engaging shopping experience.
  • Upsell and Cross-Sell:

    • Allows you to display related products, recommended items, and special offers directly within the cart drawer, encouraging customers to add more items to their cart.
  • Customization:

    • It is highly customizable, allowing you to design the cart drawer to match your store’s branding and aesthetics.
  • Real-Time Updates:

    • The cart drawer updates in real time, reflecting any changes or additions made by the customer without reloading the page.

Integrating iCart Cart Drawer Cart Upsell allows you to create a seamless and optimized shopping experience that encourages higher cart values and increases overall sales.