Copied to clipboard

Flag this post as spam?

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


  • Michelle Topp 33 posts 143 karma points
    Apr 19, 2016 @ 10:15
    Michelle Topp
    1

    Adding Custom fields for a product - Merchello

    Hi,

    Is there a way to save custom data inputted from a user to an order?

    I'm wanting to save a "name" for a product along with a selection from a variant drop down box, the name will be inputted via a text box that a user can type in and then after the order is processed I'll be using that information to create a custom pdf. I would ideally like to be able to save it against each order rather than trying to develop a custom table to save data against.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    May 10, 2016 @ 20:18
    Rusty Swayne
    100

    Hey Michelle,

    You can add a text box to your add item box and then take that value and save it to the ExtendedDataCollection in the controller (which is basically a dictionary of string, string so you will need to come up with a key like "mysiteProductMessage" or whatever.

    The extended data collections are passed from the basket, through out the checkout.

    Alternatively you could add notes to the order during checkout depending on your needs.

  • Michelle Topp 33 posts 143 karma points
    May 11, 2016 @ 09:08
    Michelle Topp
    1

    Thanks Rusty.

    Managed to figure this out, forgot I had posted this ages ago, only just been approved on the forum!

    Michelle

  • Greg 8 posts 78 karma points
    May 31, 2016 @ 18:26
    Greg
    0

    Hi Michelle,

    Would you mind sharing your approach to adding custom product data?

    Thanks,

    --GS

  • Michelle Topp 33 posts 143 karma points
    Jun 08, 2016 @ 14:46
    Michelle Topp
    1

    Hi Greg,

    Below is the code I used in the AddToBasket action:

     var extendedData = new ExtendedDataCollection();
      if (!string.IsNullOrEmpty(agName))
      {               
          extendedData.SetValue("NameofProperty", propertyValue);
      }
    

    Hope this helps

Please Sign in or register to post replies

Write your reply to:

Draft