Replies: 3 comments
-
I've found a solution which feels hacky, in the
Not sure how to move this code to the |
Beta Was this translation helpful? Give feedback.
-
I've ended adding a event listen to the
Then in the plugin I could extend the logic
This got me thinking about implementing more if the same logic in other places like the backend order view where I'd had to use this trick to override the view to add another button with functionality.
|
Beta Was this translation helpful? Give feedback.
-
Hi! 👋 Luckily, Mall provides a really nice window.Mall.Callbacks.Checkout system for exactly this purpose. I used it to make sure a pickup point was selected before allowing checkout to proceed. Here’s a simplified example:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've created a plugin to add pickup point to shipping method. If a shipping method is a parcel pickup point.
Then in the
shippingmethod.htm
partial I've added a component that shows a pickup point with a hidden field.Now the fields should be validated conditionally, but first I've tried to extend the validation in my plugin
boot()
method this is a version of the extend method that has gone through every possible variant I could think of but non of them added a validation error in the front end.What am I missing? Should the validation be added somewhere else? I'm currently using the Quick Checkout component to test this.
UPDATE:
I've added a field to the order model and I'm forcing the field to be required - problem that the validation id fired after the user is created so even if the customer chooses a point, he'll get an
this email is taken error
.Beta Was this translation helpful? Give feedback.
All reactions