Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
Hi,
You should use this instead to remove a LineItem from cart:
PurchaseOrderManager.RemoveLineItemFromOrder(cartHelper.Cart, lineItemId);
This will take care of everything for you.
Regards,
/Q
I'm using the VNext workflow on Commerce 9.22. I'm having the following issue:
- An anonymous user fills a cart
- The users removes a LineItem
- The user logs in, the transferal/merging of the cart automatically takes place but throws the following exception:
ArgumentOutOfRange_Index
Parameter name: index
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: ArgumentOutOfRange_Index
Parameter name: index
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
For removing the lineItem from the Cart i'm using the following code:
I've tried to remove the line where i remove the LineItem from the shipment, but with no effect. After the users removes the lineItem the cart is displayed like it should, and in CommerceManager the cart also contains the correct products.
Does anyone have any suggestions?