Closed artistro08 closed 3 years ago
The Variants form is loaded in a popup in the Products form, so you might have better luck extending the ProductsController
.
I thought so, but wasn't entirely sure. If you could could you show me where to hook into the popup? I'm having trouble finding the documentation for it.
Changing
- VariantsController::extendFormFields(function ($form, $model, $context) {
+ ProductsController::extendFormFields(function ($form, $model, $context) {
should already do the trick. See if this method gets called with a Variant $model
It did. Thank you!
So I'm able to extend the products field into a new tab, but I am not able to dot the same for the variants.
Is there some sort of relation I'm missing? I couldn't find out how and my code is pretty standard.
My code