Skip to content

Commit f07e040

Browse files
Chhandak.BaruaChhandak.Barua
authored andcommitted
ACP2E-3504: Product images not resized when added as configurable product
1 parent 5904b51 commit f07e040

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_wizard.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<item name="modal" xsi:type="string">configurableModal</item>
5959
<item name="dataScope" xsi:type="string">productFormConfigurable</item>
6060
</argument>
61-
<argument name="view_model" xsi:type="object">Magento\ConfigurableProduct\ViewModel\uploadResizeConfigValue</argument>
61+
<argument name="view_model" xsi:type="object">Magento\ConfigurableProduct\ViewModel\UploadResizeConfigValue</argument>
6262
</arguments>
6363
</block>
6464
<block class="Magento\ConfigurableProduct\Block\Adminhtml\Product\Steps\Summary" name="step4" template="Magento_ConfigurableProduct::catalog/product/edit/attribute/steps/summary.phtml">

app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/bulk.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,8 @@ $uploadUrl = $block->getUrl('catalog/product_gallery/upload');
771771
"component": "Magento_ConfigurableProduct/js/variations/steps/bulk",
772772
"appendTo": "<?= /* @noEscape */ $block->getParentComponentName() ?>",
773773
"noImage": "<?= /* @noEscape */ $block->getNoImageUrl() ?>",
774-
"variationsComponent": "<?= /* @noEscape */ $block->getData('config/form') ?>.configurableVariations",
774+
"variationsComponent": "<?= /* @noEscape */ $block->getData('config/form')
775+
?>.configurableVariations",
775776
"isResizeEnabled": <?= /* @noEscape */ $viewModel->isResizeEnabled() ?>,
776777
"maxWidth": <?= /* @noEscape */ $viewModel->getMaxWidth() ?>,
777778
"maxHeight": <?= /* @noEscape */ $viewModel->getMaxHeight() ?>

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/bulk.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -463,19 +463,19 @@ define([
463463
// initialize Uppy upload
464464
uppy.use(Uppy.Dashboard, options);
465465

466-
// // Use 'self.options' to access component options
467-
// if (self.options?.isResizeEnabled) {
468-
// uppy.use(Uppy.Compressor, {
469-
// maxWidth: self.options.maxWidth,
470-
// maxHeight: self.options.maxHeight,
471-
// quality: 0.92,
472-
// beforeDraw() {
473-
// if (!allowedResize) {
474-
// this.abort();
475-
// }
476-
// }
477-
// });
478-
// }
466+
// Use 'self.options' to access component options
467+
if (self.options?.isResizeEnabled) {
468+
uppy.use(Uppy.Compressor, {
469+
maxWidth: self.options.maxWidth,
470+
maxHeight: self.options.maxHeight,
471+
quality: 0.92,
472+
beforeDraw() {
473+
if (!allowedResize) {
474+
this.abort();
475+
}
476+
}
477+
});
478+
}
479479

480480
// drop area for file upload
481481
uppy.use(Uppy.DropTarget, {

0 commit comments

Comments
 (0)