Customize the product with own image file

Mar 11, 2013 at 5:06 PM
I'm trying to understand if it is possible to upload a image file (by the customer) to add a customization while adding the product into the basket.

Do you know if it is possilble to accomplish it with the current system or what is the best approach for doing this?

Mar 12, 2013 at 2:56 PM

This is a good question, thanks for asking. At the moment we do not have an optimal solution to manage customizable products but we are working on it !
First of all you should upgrade to Magelia WebStore v2.3 because it would not work with earlier versions.

Any line item in your basket / order can be populated by additional data. The additional data are then stores in the order when the basket is saved as an order.
You can use this to store the image uploaded as a blob (encoded in base64). This is probably not the cleanest solution becasue you will store the image in a database raw but it is the only way to do it for the moment.

In order to add additional data to a basket line item, you should use the following method : client.StoreClient.UpdateLineItemAdditionalData(lineItem.LineItemId, items);

Here are a few useful comments on how to use teh method :
    /// <summary>Update AdditionalData of a specified LineItem</summary>
    /// <param name="lineItemId">Identifer of the lineItem.</param>
    /// <param name="items">Collection of AdditionalDataItem to update. The previous collection of AdditionalDataItem will be replaced by this collection.</param>
    /// <remarks>
    /// If the specified lineItem is part of an Order, a new version of the order will be created. 
    /// </remarks>
    public void UpdateLineItemAdditionalData(Guid lineItemId, IEnumerable<AdditionalDataItem> items)
FYI, in the next releases of Magelia WebStore (V2.4) we will improve the way we manage bundles and personalized products.

Let us know how if the above solution works for you.

Best regards,