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?
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".
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
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
That worked great. Thanks Anders
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
Write us and I will send you the latest version of 2.0.1 - info at teacommerce.net
is working on a reply...