Copied to clipboard

Flag this post as spam?

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


  • Chris Foot 61 posts 93 karma points
    Sep 23, 2015 @ 10:39
    Chris Foot
    0

    Adding personalization options to products

    I'm currently building a site that allows customers to add a message to a product. I'm using extended data to record the message currently however, i've come upon a bit of a roadblock. If a customer adds multiple products (with the same sku) to the basket, it lumps them together into one basket line item. Is there any way to keep the line items separate so that I can list them with their respective messages?

    Thanks

    Chris

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Sep 23, 2015 @ 15:33
    Rusty Swayne
    0

    @chris - if it is the same product, could you create a collection of messages and, serialize the collection and store the entire thing in the extended data collection as JSON?

    In that way you could even keep track of quantities associated per message.

  • Chris Foot 61 posts 93 karma points
    Oct 08, 2015 @ 12:09
    Chris Foot
    0

    I had managed to get around this by setting the sku for each product when it was added to the basket, adding a unique id to each sku. It work working fine but unfortunately, I have now upgraded to 1.12.0 and it now replaces the custom sku with the one from the product when doing Basket.SalePreparation(). Is there any way to stop it doing this? My site was due to launch today :(

    Chris

  • Chris Foot 61 posts 93 karma points
    Oct 08, 2015 @ 12:22
    Chris Foot
    0

    Don't worry, i've just discovered merchLineItemAllowsValidation

    Thanks

    Chris

  • Umang Desai 3 posts 76 karma points
    Dec 09, 2015 @ 16:41
    Umang Desai
    0

    Hi Chris,

    I'm trying to add this around basket.Additem line. How can I apply it?

       var product = Newtonsoft.Json.JsonConvert.DeserializeObject<ProductAddtoCartModel>(payload);
    
       var extendedData = new ExtendedDataCollection();
            extendedData.SetValue("key-v2", product.cfgWidth.ToString());
            extendedData.SetValue("merchLineItemAllowsValidation", "false"); // i imagine I'm going wrong around here.
    
       var customer = customerContext.CurrentCustomer; 
            var basket = customer.Basket();
            basket.AddItem(product.reqProductName, product.reqProductSku, product.reqQty, 50, extendedData);
    

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft