iterate through a shopping cart

Posted by Community Admin on 05-Aug-2018 01:15

iterate through a shopping cart

All Replies

Posted by Community Admin on 08-Jun-2013 00:00

I'm looking for a simple example of how to iterate through a shopping cart to do some error checking.... e.g. if the total of product type X is OK then ok, else not.

Posted by Community Admin on 10-Jun-2013 00:00

Hello Tim,

 

private void CartDetails(Guid cartId, Guid cartOrderId)
        
            var om = OrdersManager.GetManager();
            var details = om.GetCartDetails();
            var cart = om.GetCart(cartId);
            var cartOrder = om.GetCartOrder(cartOrderId);
        

You need to get an instance of the OrdersManager. From there you can get the cart itself, the cart details (price, etc), and the CartOrder (products, etc).

I hope this helps.

Regards,
Patrick Dunn
Telerik
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed