I’m trying to implement a validator for the quantity field on these entities:
I added a new Contraint and Validator to check the quantity value considering some custom logic. The validator is working fine when I’m on backend side.
For example, on backend, when I’m creating a new order, if I try to add a product with an invalid quantity I got my validator running and displaying the message I defined. Very nice!
But, I was expecting to have this working on frontend side too. My goal is to apply this validation when I add a new product to a shopping list (or update), but it’s not working.
Are there some config I need to add to have these available on frontend, or are these validators only working for backend?
Can you explain how can I add a validator that can cover all contexts? I mean, backend and frontend side.
my validation.yml:YAML1234567891011121314Oro\Bundle\OrderBundle\Entity\OrderLineItem:properties:quantity:- Test\Bundle\MyBundle\Validator\Constraints\MyConstraint: ~Oro\Bundle\ShoppingListBundle\Entity\LineItem:properties:quantity:- Test\Bundle\MyBundle\Validator\Constraints\MyConstraint:Oro\Bundle\CheckoutBundle\Entity\CheckoutLineItem:properties:quantity:- Test\Bundle\MyBundle\Validator\Constraints\MyConstraint: ~
Thanks for helping ;)
The forum ‘OroCommerce’ is closed to new topics and replies.