Skip to content

Commit fca9024

Browse files
committed
ACP2E-1239: Shifting of the PDP main image
- Fixed the issue.
1 parent 220d951 commit fca9024

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

app/code/Magento/Catalog/Block/Product/View/GalleryOptions.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ public function getOptionsJson()
105105
$optionItems['thumbmargin'] = (int)$this->escapeHtml($this->getVar("gallery/thumbmargin"));
106106
}
107107

108+
if ($this->getVar("product_image_white_borders")) {
109+
$optionItems['whiteBorders'] =
110+
(int)$this->escapeHtml($this->getVar("product_image_white_borders"));
111+
}
112+
108113
return $this->jsonSerializer->serialize($optionItems);
109114
}
110115

@@ -151,6 +156,11 @@ public function getFSOptionsJson()
151156
(int)$this->escapeHtml($this->getVar("gallery/fullscreen/thumbmargin"));
152157
}
153158

159+
if ($this->getVar("product_image_white_borders")) {
160+
$fsOptionItems['whiteBorders'] =
161+
(int)$this->escapeHtml($this->getVar("product_image_white_borders"));
162+
}
163+
154164
return $this->jsonSerializer->serialize($fsOptionItems);
155165
}
156166
}

lib/web/mage/gallery/gallery.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ define([
115115
config.options.thumbwidth = _toNumber(config.options.thumbwidth);
116116
config.options.thumbheight = _toNumber(config.options.thumbheight);
117117

118+
config.options.whiteBorders = _toNumber(config.options.whiteBorders);
119+
118120
config.options.swipe = true;
119121
this.config = config;
120122

@@ -132,7 +134,10 @@ define([
132134
data: _.clone(config.data)
133135
};
134136
config.options.ratio = config.options.width / config.options.height;
135-
config.options.height = $(element).height();
137+
config.options.height = null;
138+
if (!config.options.whiteBorders) {
139+
config.options.height = $(element).height();
140+
}
136141

137142
$.extend(true, this.startConfig, config);
138143

0 commit comments

Comments
 (0)