Force empty cart on page load

Hi there,

My client wants every customer to start with an empty cart regardless of if they have put things into it from the past. Every time the page is loaded, is it possible to force a reset so the cart is empty??


While I’m not sure if this is possible - has your client thought about the actual user experience of clearing a cart on page load?

  • Let’s say I add visit your website’s home page – an onpageload event is fired off, my cart is emptied.
  • I navigate to a product page from the home page – an onpageload event is fired off, my cart is emptied.
  • I add that product to my cart and decide to go to the Store page to add more items – an onpageload event is fired off, my cart - though I just added a product - is emptied.
  • I add a new product, then go to the checkout page – my cart is emptied.

If it is at all possible to remove products from the user’s cart with some custom JS (paging @kkilat, @Waldo), I would consider potentially doing this as a time-based action - as in, empty the cart if the user leaves and returns after 1 day, 3 days, 7 days, etc. This could be achieved with a cookie or by using local storage. (I wrote a snippet that might be of use to for another forum post.)

Just my (unsolicited) two cents! Hopefully Waldo or Kyle will be able to fill in whether it’s actually possible.

My client is using the e-com for an event. Each person can only have 1 ticket. I have removed off the quantity and I’m controlling the user journey by showing and hiding items so they only ever have 1 item in the cart. This works fine till someone goes back to the start and tries to do it again.

Hi, @Fagan_Wilcox!

Ben here with the Webflow Customer Support Team!

If you’re looking to run an event and provide limitations you may look at using Eventbrite with your Webflow site:

Unfortunately, the functionality you’re looking for isn’t native to Webflow yet.

This could be an awesome feature to have in Webflow, and it’s definitely something you could post in our Webflow Wishlist.

Our Wishlist is part of our Community-driven product roadmap, and we use the votes and feedback for each Wishlist item to determine what the Community wants to see the most!

Let me know if you have any other questions, and I’ll be happy to assist you further!

1 Like