Dawn Theme: Cart Notification Auto hide after popup

Hello, everyone!

I was wondering how I could go about making the Cart Notification popup disappear on its own a few seconds after an item is added to the cart.

Basically once a user adds an item to their cart, the cart notification popup will slide down from the top like it normally does, but instead of just staying visible, it will automatically slide back up after a few seconds. I know a bunch of websites have the functionality already so it cant be too hard to implement…

Thank you.

Hi @MondayForward ,

Just follow the instructions below.

  1. Go to Admin > Online store > Themes > Actions > Edit code
  2. Go to Asset folder, and open the cart-notification.js
  3. Find the renderContents(parsedState), before the closing curly bracket paste the code below.

NOTE: This will close the notification after 2 secs, which is equal to 2000. Change the 2000 to how many seconds you want.

setTimeout(() => {this.close()}, 2000)

Please refer below for code placement

1 Like

Thank you so much!

1 Like