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?
@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.
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 :(
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);
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
@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.
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
Don't worry, i've just discovered merchLineItemAllowsValidation
Thanks
Chris
Hi Chris,
I'm trying to add this around basket.Additem line. How can I apply it?
Thanks
is working on a reply...