[Question] Overwrite CartStockAvailabilityValidator #2420
Unanswered
lukadschaak
asked this question in
Q&A
Replies: 2 comments 1 reply
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
@dpfaffenbauer Thank for your fast answer. Some thoughts for future reader:
Good suolution over all, but a bit unintuitive because aliases must be used.
Code must be overwritten for this approach. Not our favorite solution.
If your mean the config files (.yml), then as far as i know this is not possible for validation: https://symfony.com/doc/current/bundles/override.html#validation-metadata |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Moin!
We are currently working on overriding some validators for the checkout. For various reasons. In one case we have a sort of sub items whose stock we also want to validate. So we would like to override the
CartStockAvailabilityValidator
.What is the best way to do this? In the checkout steps, the order is validated in its entirety, and the contraints for this are configured here.
Unfortunately, we cannot replace validators. The configuration can only be extended, but not overwritten. Do we have to decorate the class now or what would be the best practice?
Beta Was this translation helpful? Give feedback.
All reactions