-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Be able to edit large config products in backend #39
Comments
Hi @peterjaap |
@zaiatsFlagbit no I hadn't considered that. We're not using this extension anymore bytheway, @gaiterjones took over maintaining it. |
@zaiatsFlagbit I think paginating the variation data could be an option so the user loads the variations manually per variation page click. I have not worked with a configurable product with more than 1000 variations before so have not seen any memory problems whilst creating variation data. Can you provide more info as to your server RAM config, how much mem is available to PHP? |
@gaiterjones I created a module, implementing pagination for Large_Configurable_Products. |
@zaiatsFlagbit your module looks very interesting, great work - did you test it with this module too or are you happy to simply paginate the variations to improve loading? I will test it as soon as can. |
@gaiterjones - yes, I am using elgentos module alongside, but not as a dependency. At the moment testing new module flow. Upcoming changes. |
...by removing the variations matrix in the edit screen. Here's some work on it I did so far;
Comment out in
vendor/magento/module-configurable-product/etc/adminhtml/di.xml
to remove the matrix variations grid from the product edit screen in the backend for configurables;Edit the PHP class that retrieves the variations (this is the memory culprit);
\Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Variations\Config\Matrix::getVariations
add;return [];
Then we need to fix a small JS validation error:
vendor/magento/module-configurable-product/view/adminhtml/web/js/variations/variations.js::exports.changeButtonWizard
line 183 change to;if (this.variations && this.variations.length) {
This is where the simple products are connected to the configurable when it is saved;
\Magento\ConfigurableProduct\Controller\Adminhtml\Product\Initialization\Helper\Plugin\Configurable::afterInitialize
, that's a plugin for\Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper::initialize
\Magento\Catalog\Controller\Adminhtml\Product:100
is where Magento builds up the product according to the POST request. The changes we just did cause Magento to de-couple the simples from the configurable since the POST param is empty.In
\Magento\ConfigurableProduct\Model\Product\TypeTransitionManager\Plugin\Configurable::aroundProcessProduct
the configurable products is transitioned to a simple product since theattributes
field is empty.So we need to comment out
$this->productTypeManager->processProduct($product);
in\Magento\Catalog\Controller\Adminhtml\Product\Save
to make sure a configurable product isn't converted to a simple product, which causes the product relations to be removed.It would be great if we can do the above based on the number of childs the configurable have, and make this a configurable setting. For me, about 3000 products is where the server throws a memory limit error but this could be different for another server.
Obviously, this is just the happy path. I haven't done any testing at all whether it affects other parts of Magento.
The text was updated successfully, but these errors were encountered: