Use Cart Drawer for Adding to Cart but Pressing Cart Icon goes to Cart Page

Well Bryan, it’s a bit of a hack, but this seems to be working.

In cart-drawer.js, you should find this line:

this.setHeaderCartIconAccessibility();

This line is calling a function that:

  1. disables the default click behavior of the cart link (event.preventDefault():wink:

  2. opens the cart drawer (this.open(cartLink):wink:

In other words, the cart drawer code is hijacking the default behavior of the header cart link and instead forcing it to open the drawer.

So I just commented out that line as follows:

// this.setHeaderCartIconAccessibility();

I would like to know if this works for you as well.

Don