Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hi,
The project which contains CartHelper (Mediachase.Commerce.Website) is open-source and you can modify it your self http://world.episerver.com/download/Items/EPiServer-Commerce/episerver-commerce-9-tools-and-code-samples/
Regards,
/Q
Hi,
I am not sure about question but if I am correct in understanding you can use one of those
public virtual LineItem AddEntry(Entry entry);
public virtual LineItem AddEntry(Entry entry, bool fixedQuantity);
public virtual LineItem AddEntry(Entry entry, params CartHelper[] helpersToRemove);
public virtual LineItem AddEntry(Entry entry, bool fixedQuantity, params CartHelper[] helpersToRemove);
public virtual LineItem AddEntry(Entry entry, decimal quantity, bool fixedQuantity, string warehouseCode, params CartHelper[] helpersToRemove);
a line item can also be added in OrderForm.LineItemCollection I guess
/K
CartHelper.AddEntry will wrap up the items by default. Unfortunately there is no flag to control this, but you can re-implement the relevant methods in CartHelper (as they are private). From what I've heard there will eventually be a surgery on CartHelper since it's not a very helpful (or extendable) class.
Also check Quan's answer in other topic: http://world.episerver.com/forum/developer-forum/Episerver-Commerce/Thread-Container/2016/3/several-rows-in-tha-cart-for-same-variant/
Hello,
We would like to add a new line item to a basket (instead of using CartHelper.AddEntry, which would just append the quantity if the entry is already in the cart). However this seems to be a very "manual" process, the CartHelper.CreateLineItem method is private, so we would have to rewrite this method, then manually set PlacedPrice, Quantity, Code, Name/Display Name etc.
Is there something I'm missing? It just seems odd having to rewrite code already in the EPi dlls. Is there a flag or something I can pass to AddEntry which will do this?
Thanks!
Dean