Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Jameskn 64 posts 78 karma points
    Feb 15, 2011 @ 13:07
    Jameskn
    0

    AddToBasket Function

    public static XPathNodeIterator AddToBasket(string catalogName, int quantity, string sku, string variantSku, bool addToExistingLine)

    Hi, 

    So in an ideal world I would like to call the above function in a user control and for it not to return a XPathNodeItrerator is there a nice simple AddToBasket which would return me a true or false of success and ref for any error messages. 

    Otherwise to use the above function a user control you have to parse the actually XML back out and then grab the error from there.. Not impossible but not cleaniest way of doing it. 

    Any ideas?

    James

     

  • Søren Spelling Lund 1797 posts 2786 karma points
    Feb 15, 2011 @ 13:45
    Søren Spelling Lund
    0

    You can use SiteContext.Current.OrderContext.GetBasket().PurchaseOrder.AddProduct() which will return the order line the product was added to. The *Context classes are a good way to access the same functionality found in CommerceLibrary.

    Here's the reference for the AddProduct method http://www.ucommerce.dk/docs/html/M_UCommerce_Entities_PurchaseOrder_AddProduct.htm

  • Don Ross 28 posts 49 karma points
    Nov 29, 2011 @ 16:39
    Don Ross
    0

    I am finding that the following call does not return the pricegroupprice, therefore preventing the product to be added to the basket.

    var item = Product.SingleOrDefault(x => x.Sku == sku);

    Anyone have any ideas? The pricegroupprice is definitely set for the product and exists in the pricegroupprice table.

    Thanks

    Don

  • Søren Spelling Lund 1797 posts 2786 karma points
    Dec 13, 2011 @ 14:48
    Søren Spelling Lund
    0

    Is it the right call there? I was expecting a call to PurchaseOrder.AddProduct or Product.GetPrice.

    Could you clarify?

    Thanks,

Please Sign in or register to post replies

Write your reply to:

Draft