Copied to clipboard

Flag this post as spam?

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


  • Nicolas Gangloff 19 posts 99 karma points
    Apr 01, 2013 @ 05:07
    Nicolas Gangloff
    0

    Passing custom properties to productLine object in TC 2

    Hi

    I am currently working with the TC 2 starter kit. I hooked up the OrderLinesAdding event and I am looking for information on how to populate the orderLines[0].Properties object from the Razor page. I see in macroScript/product/view.chtml there is the AddOrUpdateOrderLine hidden input that could be used for this purpose but I am not sure on how to use it. Could you give me some guidance on this issue?

    Thank you for your support

    Nico

  • Anders Burla 2560 posts 8256 karma points
    Apr 02, 2013 @ 08:36
    Anders Burla
    101

    Hi Nicolas

    One way you can do it, IF the value you need is already specified at the Umbraco product node is to add the property alias of the property you want to copy from your node to your order line in the Tea Commerce admin section on the store you have created. Just click the store node.

    In the newest Tea Commerce 2.0.1 we did a breaking change to the way you add properties using the HTML api - so write me an email and I will send you a nightly build of 2.0.1. The way you would do it is having a key/value in you AddOrUpdateOrderLine hidden field. value="productIdentifier : productIdentifier, properties : properties". Then have a html hidden input named properties with the property key and the html element to deliver the value. So have input type="hidden" name="properties" value="size : size, otherKey : htmlField". Then have two hidden input field (or other html form tags, select, text etc.) name="size" value="Large".

    Kind regards
    Anders

  • Nicolas Gangloff 19 posts 99 karma points
    Apr 04, 2013 @ 01:29
    Nicolas Gangloff
    0

    That worked great. Thanks Anders

  • Bjørn Fridal 274 posts 784 karma points
    Apr 10, 2013 @ 16:01
    Bjørn Fridal
    0

    Hi Anders,

    I am trying to add custom properties as described here, but I can see that you're saying it works in 2.0.1

    Is there a way to make it work in 2.0 or is it possible to get access to the 2.0.1?

    Cheers
    Bjørn 

  • Anders Burla 2560 posts 8256 karma points
    Apr 10, 2013 @ 16:26
    Anders Burla
    0

    Write us and I will send you the latest version of 2.0.1 - info at teacommerce.net

Please Sign in or register to post replies

Write your reply to:

Draft