I'm currently working on our second Vendr solution. And also this time it isn't a standard webshop :)
Products has 3 prices (per day, week and month) and I will calculate the order line price from rent periode - that's not a problem (yet).
But I can see, that when none of the price properties in the document type definition is called "price" I can't add a product to the cart. I get an exception with a message "ValidationException: Can't add a Product to an Order where there is no price for the Order currency."
I can do that, if I change property name of one of the prices to "price".
I think I have seen a setting to the price property alias, but I can't find it.
Or I need to use "price" as price alias?
Umbraco 9, Vendr 2.1
Kind regards
Tomasz
PS. Maybe I'm getting this exception now, because I haven't coded the OrderLineCalculator yet...
EDIT:
OK. I found it in documentation. It has to be "price":
I can't quite recall all the places the "price" property is accessed, but you could try removing that specific validation rule and just see what happens.
You can remove that validation rule in your composer / startup code (making sure this runs after our startup code)
Product price alias
Hi,
I'm currently working on our second Vendr solution. And also this time it isn't a standard webshop :)
Products has 3 prices (per day, week and month) and I will calculate the order line price from rent periode - that's not a problem (yet).
But I can see, that when none of the price properties in the document type definition is called "price" I can't add a product to the cart. I get an exception with a message "ValidationException: Can't add a Product to an Order where there is no price for the Order currency."
I can do that, if I change property name of one of the prices to "price".
I think I have seen a setting to the price property alias, but I can't find it.
Or I need to use "price" as price alias?
Umbraco 9, Vendr 2.1
Kind regards
Tomasz
PS. Maybe I'm getting this exception now, because I haven't coded the OrderLineCalculator yet...
EDIT: OK. I found it in documentation. It has to be "price":
https://vendr.net/docs/core/1.6.0/key-concepts/umbraco-properties/
Hey Tomasz
I can't quite recall all the places the "price" property is accessed, but you could try removing that specific validation rule and just see what happens.
You can remove that validation rule in your composer / startup code (making sure this runs after our startup code)
This should prevent that validator from running and thus the validation exception.
We'll just have to see if there are any additional errors after this one 😁
Hi Matt,
That did the trick.
Thanx :)
is working on a reply...