Cart Drawer to Open up when a product is added to cart

Topic summary

Goal: In the Shopify Dawn theme, make the cart drawer (slide-out mini cart) automatically open as soon as a product is added to the cart.

Context: The store URL and password were shared for troubleshooting. A responder provided code that successfully handled add-to-cart, but it currently navigates to a separate cart page.

Current issue: Instead of redirecting, the requester wants the cart drawer to open immediately after the add-to-cart action.

Status: Partially resolved. The add-to-cart works, but the desired behavior (open cart drawer rather than page redirect) is not yet achieved.

Next step requested: Guidance or code to trigger the cart drawer to open automatically in Dawn after an item is added, without leaving the current page. Discussion remains open.

Summarized with AI on January 1. AI used: gpt-5.

Hi there

I was wondering if someone can maybe assist me please, I would like my cart-drawer to open up as soon as a product is added to my cart.

I am using Dawn Theme. If someone could maybe assist me please.

Thank you.

Hi there thank you for your reply.

Sure.

URL: https://9a0bad-3.myshopify.com

Password: saipru

Hi there,

Thank you so much for the above code. It did work :slightly_smiling_face: However I was wondering if the cart Drawer can just open up, instead of going to a new page?