Developer forum

Forum » Development » Only remove lines

Only remove lines

Anders Ebdrup
Reply

Hello,

 

Have anyone tried only to remove lines when emptying the cart and not clearing the whole cart?

 

Best regards, Anders


Replies

 
David Matheson
Reply

It is standard functionality.  See the standard template /Templates/eCom7/CartV2/Step/ShowCart.html - starting at line 27 within the loop OrderLines

 

// David

 
Anders Ebdrup
Reply

Hi David,

 

Thanks for your answer, but I am looking for an option to remove all lines at once, but still keep the informations on the order (EcomOrders)

 

Best regards, Anders

 
David Matheson
Reply

display: none; ?????

 
Anders Ebdrup
Reply

Hi David,

 

By setting "display: none" on the lines doesn't mean that the lines actually are removed from the cart :-)

 

Best regards, Anders

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Hi Anders and David,

It's not possible to do directly via the available cart commands. The class that picks up the cart commands has checks built in to clear a cart when there are no more orderlines.

In order to do this, you have to do it from code. You may run into issues doing this though, as the cart will actively try to clear carts with no orderlines.

- Jeppe

 

You must be logged in to post in the forum