Skip to content

Commit 6c5dd94

Browse files
committed
19276 - Fixed price renderer issue
1 parent 7755eef commit 6c5dd94

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
@@ -902,7 +902,8 @@ define([
902902
$productPrice = $product.find(this.options.selectorProductPrice),
903903
options = _.object(_.keys($widget.optionsMap), {}),
904904
result,
905-
tierPriceHtml;
905+
tierPriceHtml,
906+
isShow;
906907

907908
$widget.element.find('.' + $widget.options.classes.attributeClass + '[option-selected]').each(function () {
908909
var attributeId = $(this).attr('attribute-id');
@@ -919,11 +920,9 @@ define([
919920
}
920921
);
921922

922-
if (typeof result != 'undefined' && result.oldPrice.amount !== result.finalPrice.amount) {
923-
$(this.options.slyOldPriceSelector).show();
924-
} else {
925-
$(this.options.slyOldPriceSelector).hide();
926-
}
923+
isShow = typeof result != 'undefined' && result.oldPrice.amount !== result.finalPrice.amount;
924+
925+
$product.find(this.options.slyOldPriceSelector)[isShow ? 'show' : 'hide']();
927926

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

0 commit comments

Comments
 (0)