Skip to content

Commit 2efca57

Browse files
authored
ENGCOM-3608: 19276 - Fixed price renderer issue #19376
2 parents fb4a0ad + ee4da69 commit 2efca57

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,8 @@ define([
924924
$productPrice = $product.find(this.options.selectorProductPrice),
925925
options = _.object(_.keys($widget.optionsMap), {}),
926926
result,
927-
tierPriceHtml;
927+
tierPriceHtml,
928+
isShow;
928929

929930
$widget.element.find('.' + $widget.options.classes.attributeClass + '[option-selected]').each(function () {
930931
var attributeId = $(this).attr('attribute-id');
@@ -941,11 +942,9 @@ define([
941942
}
942943
);
943944

944-
if (typeof result != 'undefined' && result.oldPrice.amount !== result.finalPrice.amount) {
945-
$(this.options.slyOldPriceSelector).show();
946-
} else {
947-
$(this.options.slyOldPriceSelector).hide();
948-
}
945+
isShow = typeof result != 'undefined' && result.oldPrice.amount !== result.finalPrice.amount;
946+
947+
$product.find(this.options.slyOldPriceSelector)[isShow ? 'show' : 'hide']();
949948

950949
if (typeof result != 'undefined' && result.tierPrices.length) {
951950
if (this.options.tierPriceTemplate) {

0 commit comments

Comments
 (0)