Skip to content

Commit 1323166

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

File tree

1 file changed

+7
-8
lines changed
  • app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps

1 file changed

+7
-8
lines changed

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ define([
3737
error: null
3838
},
3939
options: {
40-
isResizeEnabled: false,
41-
maxWidth: 1920,
42-
maxHeight: 1080
40+
isResizeEnabled: ''
4341
}
4442
},
4543

@@ -79,9 +77,9 @@ define([
7977

8078
// Retrieve configuration passed from .phtml
8179
if (config) {
82-
this.options.isResizeEnabled = config.isResizeEnabled || false;
83-
this.options.maxWidth = config.maxWidth || 1920;
84-
this.options.maxHeight = config.maxHeight || 1080;
80+
this.options.isResizeEnabled = config.isResizeEnabled;
81+
this.options.maxWidth = config.maxWidth;
82+
this.options.maxHeight = config.maxHeight;
8583
}
8684

8785
this.variationsComponent(function (variationsComponent) {
@@ -462,9 +460,10 @@ define([
462460

463461
// initialize Uppy upload
464462
uppy.use(Uppy.Dashboard, options);
465-
466463
// Use 'self.options' to access component options
467-
if (self.options?.isResizeEnabled) {
464+
self.options = self.options || {};
465+
466+
if (self.options.isResizeEnabled ?? false) {
468467
uppy.use(Uppy.Compressor, {
469468
maxWidth: self.options.maxWidth,
470469
maxHeight: self.options.maxHeight,

0 commit comments

Comments
 (0)