Check out Oracle NetSuite upcoming events and conferences here
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Update your Profile with your Support type to get your Support Type badge.
Expand your NetSuite knowledge by joining our Ask A Guru Live sessions. RSVP on this event now.
Don't miss out on our Question of the week! You only have until tomorrow, May 23, 2024, 2PM ET to comment your answers and earn rewards! Click here for more details.
Community Poll: What sort of content would you like to see more of?

Elbrus- Creating a Clear Cart Button

edited Dec 18, 2019 1:45AM in Web Site / E-Commerce 3 comments

Hello everyone,

I have a created a button to clear all items form the cart but it is acting strangely.

When I have a larger number of items (for example, a quantity of 5 on 4 items) it clears the cart then adds one of the items back in. If you press the button again it will clear the cart as normal. The code I used is below and it doesn't mention anything about adding to the cart.

 clearCart: function()   {      var cart = LiveOrderModel.getInstance();        for (var i = cart.attributes.lines.models.length - 1; i >= 0; i--)  {          cart.removeLine(cart.attributes.lines.models[i]);      }  } 

Howdy, Stranger!

Log In

To view full details, sign in.


Don't have an account? Click here to get started!


Community Whiz

Quarter 2 ((Apr-Jun 2024) )

This Week's Leaders

This Month's Leaders

All Time Leaders