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.

  • Marc Love (uSkinned.net) 432 posts 1691 karma points
    Dec 19, 2012 @ 18:53
    Marc Love (uSkinned.net)
    0

    Dynamic Product Properties

    Is it possible to add dynamic product properties to a product in your shopping cart similar to dynamic order properties?

    I have a product that needs to have 3 dropdown options:

    Liquid type (3 options)

    Bottle Size (2 options)

    Bottle Strength (4 options)

    Bottle size is the only option that changes the price, the other two are just for information only, however I need this information attached to a product that has been added to the cart. I only want to create 2 variant options for bottle size. If I was to create a variant for each possible combination, I would need to create 24 variations for each product which will be a nightmare to maintain.

    Can anyone point me in the right direction?

    Cheers,

    Marc

  • Marc Love (uSkinned.net) 432 posts 1691 karma points
    Dec 19, 2012 @ 19:36
    Marc Love (uSkinned.net)
    0

    I have looked into this a bit further and thought I could get product definition fields that have not been checked as a variant.

    I am using the following code but there seems to be a problem with my linq statement:

    var product = SiteContext.Current.CatalogContext.CurrentProduct;

    var productdefinition = product.ProductDefinition;

    var productdefinitionfields = productdefinition.ProductDefinitionFields.SelectMany(x => x.IsVariantProperty == false);

    I am new to uCommerce and Linq so may be completely off track here..

     

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Dec 20, 2012 @ 14:46
    David Brendel
    1

    A product in the cart is represented by an OrderLine class. If I'm right than an OrderLine can also have dynamic properties like the order itself.

    So i think it's just like that: line["bottle_size"] = 2;

    At the time you add your products to the cart you can add the propertys aswell.

    Maybe you can try that? Or have i misunderstood what you want to do?

  • Marc Love (uSkinned.net) 432 posts 1691 karma points
    Dec 20, 2012 @ 15:43
    Marc Love (uSkinned.net)
    0

    Hi David,

    Yes, thats the idea. Will give it a go.

    Cheers,

  • Søren Spelling Lund 1797 posts 2786 karma points
    Dec 21, 2012 @ 13:33
    Søren Spelling Lund
    0

    Hi David,

    Thanks for being awesome and helping out with the answer.

    There's more information available in Dynamic Order Properties: Adding Custom Information to Baskets, Orders, and Order Lines.

    Hope this helps.

  • saravana 26 posts 45 karma points
    May 24, 2013 @ 14:20
    saravana
    0

    Hi Soren,

    I tried this step while the order is in Basket and it works fine.

    But when trying to save the dynamic properties after the checkout process, it doesn't works. Please help me.

    Thanks in Advance

  • Jesper Nielsen 141 posts 498 karma points
    May 27, 2013 @ 10:35
    Jesper Nielsen
    0

    Hi Saravana,

    Where are you calling save? Is it in a pipeline? Please provide a bit more detail.

    If you are trying to modify a basket after checkout, please remember you have to get it from the guid.

    Kind regards,

    Jesper

  • saravana 26 posts 45 karma points
    May 27, 2013 @ 11:38
    saravana
    0

    Hi Jesper,

    Thanks for your reply.

    Please review the below coding

    TransactionLibrary.ExecuteBasketPipeline();
    TransactionLibrary.Checkout();
    var order = PurchaseOrder.SingleOrDefault(x => x.OrderGuid == new Guid(orderGuid));
    order["Payment Auth Code"] = items._ccReply_authReplyCode;

    The "Payment Auth Code" is the dynamic property which is to be saved after the checkout process, but its not saving.

     

  • Nickolaj Lundgreen 233 posts 1132 karma points
    May 28, 2013 @ 08:38
    Nickolaj Lundgreen
    1

    Im pretty sure you are missing a order.Save()

    (don't know why the original message was blank)

  • saravana 26 posts 45 karma points
    May 28, 2013 @ 09:12
    saravana
    0

    Thanks a lot Nickolaj,

    As you mentioned i have missed order.Save().

    Now its working

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jun 03, 2013 @ 10:30
    Søren Spelling Lund
    0

    Good to see that it's working.

    Thanks for being awesome and helping find the answer, Nickolaj!

Please Sign in or register to post replies

Write your reply to:

Draft