ShoppingServiceSaveCart Method |
Validates and saves the shopping cart into the database.
Namespace: CMS.EcommerceAssembly: CMS.Ecommerce (in CMS.Ecommerce.dll) Version: 12.0.0
Syntax Exceptions Exception | Condition |
---|
InvalidOperationException | Thrown when validation of shopping cart, its items, customer addresses, payment or shipping option fails. |
Remarks
It is not necessary to call this method after modifying a shopping cart through the other methods of the
ShoppingService
(adding or removing items, setting the customer, addresses, shipping and payment options, etc.). These methods save the shopping cart automatically.
The method is useful when you need to save a shopping cart to the database after it gets modified outside of the
ShoppingService.
For example, call the method after validating the cart prior to checkout (e.g. this could remove cart items which are sold out).
See Also