You can add all the order line properties you want when calling the addOrderLine method. The properties are sent as form data to the server, not with the rest api.
Call the addOrderLine method like this: TeaCommerce.addOrderLine([product id], 1, {properties:{variantId: [id of variant]}});
Add parameter to AddOrderLine method
Hi
How can i add some parameters to AddOrderLine method?
The parameter that i want to add to AddOrderLine method is not bound to product, so i can't obtain it server side.
I've see that when the AddOrderLine method is fire form javascript, it call a specific page via ajax, passing the parameters via REST, something like: http://www.teacommerceexample.com/tcbase/teacommerce/AddOrderLine/{nodeId} /{quantity}/...
When i try to add a parameter, server side i obtain this error: Parameter count mismatch.
Some one can help me?
Thanks
Alessandro
Hi Alessandro,
You can add all the order line properties you want when calling the addOrderLine method. The properties are sent as form data to the server, not with the rest api.
Call the addOrderLine method like this:
TeaCommerce.addOrderLine([product id], 1, {properties:{variantId: [id of variant]}});
To read more about the method go here:
http://rune.gronkjaer.dk/en-US/2010/11/16/tea-commerce-javascript-api/#addOrderLine
Hope this answers your question.
/Rune
Hi Rune
Thank you so much for the quick response, you solve my problem.
Alessandro
No problem. Just happy to help. Please mark my answer for future reference.
/Rune
is working on a reply...