iterate through a shopping cart - Ecommerce - Ecommerce - Progress Community

iterate through a shopping cart

 Ecommerce

iterate through a shopping cart

  • iterate through a shopping cart
  • 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.

  • 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