Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
In this example I have updated 2 orderlines for each product by increasing the quantity for each.
Within a loop:
The call to TC.AddOrUpdateOrderLine is fine but trying to update the TeaCommerce_CustomOrderLineProperty seems to be problematic.
I tried TC.AddOrUpdateOrderProperties(1, customPropertiesToAdd) but that didn't work.
Tried TC.AddOrUpdateOrderProperty(1, "actualPrice", "40") but didn't work.
Tried updateProperties1.Database.ExecuteSqlCommand(....) but only the 2nd out of the two loops updated.
I tried Dispose() at the end of each command but this made no difference.
If I added a condition to capture only the first index  in the loop, the property is updated but it appears that only the last command updates the table.
How can I loop through each quantity update in the order and update the TeaCommerce_CustomOrderLineProperty for every orderline?
You might want to try making the changes directly on the order lise itself and then saving the order.
You can go orderLine.Properties.AddOrUpdate(...)
That works for me.
Also you might want to use som of the event hooks to be able to add the properties when the order line is first created:
/Rune - Tea Solutions
thanks. I'll try this and get back.
Cool. Please let us know if it gives you any trouble!
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted