My "problem" is, that I need to calculate orderline price based on other custom properties. I would like to secure situation, that this properties was not set correctly. Is there a way to f.x redirect site in this "event", or just to "let know" that price can not be calculated?
I was thinking about setting some additional custom orderline property, but I don't know if this is good approach.
If you need properties added to the order line which is data from the umbraco node - then just add the property alias to the comma seperated list in the store settings at the "Product" tab. It is called "Order line property aliases". Then those properties will be added and customer ca't change them.
Calculators always need to return a decimal - so you cant make a calculator fail. Your UI would need to make sure that products are added with the right info.
CalculateOrderLineUnitPrice and order line property
Hi,
Can I add an order line property inside CalculateOrderLineUnitPrice method?
I have tried something like this:
but "Add to cart" button freezes at adding to cart.
Best regards Thomas
If you do anything in the calculator - DONT save the order. That is saved at a later time. So now you create an infinite loop :)
Kind regards
Anders
I tought so :)
My "problem" is, that I need to calculate orderline price based on other custom properties. I would like to secure situation, that this properties was not set correctly. Is there a way to f.x redirect site in this "event", or just to "let know" that price can not be calculated? I was thinking about setting some additional custom orderline property, but I don't know if this is good approach.
Best regards Thomas
Hi Thomas
If you need properties added to the order line which is data from the umbraco node - then just add the property alias to the comma seperated list in the store settings at the "Product" tab. It is called "Order line property aliases". Then those properties will be added and customer ca't change them.
Calculators always need to return a decimal - so you cant make a calculator fail. Your UI would need to make sure that products are added with the right info.
Kind regards
Anders
is working on a reply...