+1-888-365-2779
Try Now
More in this section

Forums / Ecommerce / iterate through a shopping cart

iterate through a shopping cart

2 posts, 0 answered
  1. Tim
    Tim  avatar
    34 posts
    Registered:
    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
    Registered:
    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.

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