More in this section
Forums / Ecommerce / iterate through a shopping cart

iterate through a shopping cart

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Tim
    Tim  avatar
    34 posts
    16 Oct 2012
    08 Jun 2013
    Link to this post
    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.

  2. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    03 Nov 2014
    10 Jun 2013
    Link to this post
    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.

    Patrick Dunn
    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
2 posts, 0 answered