Skip to content

Commit ea9f868

Browse files
ENGCOM-3608: 19276 - Fixed price renderer issue #19376
- Merge Pull Request #19376 from sarfarazbheda/magento2:19276-fixed-price-renderer-issue - Merged commits: 1. 6c5dd94
2 parents 5498231 + 6c5dd94 commit ea9f868

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
@@ -907,7 +907,8 @@ define([
907907
$productPrice = $product.find(this.options.selectorProductPrice),
908908
options = _.object(_.keys($widget.optionsMap), {}),
909909
result,
910-
tierPriceHtml;
910+
tierPriceHtml,
911+
isShow;
911912

912913
$widget.element.find('.' + $widget.options.classes.attributeClass + '[option-selected]').each(function () {
913914
var attributeId = $(this).attr('attribute-id');
@@ -924,11 +925,9 @@ define([
924925
}
925926
);
926927

927-
if (typeof result != 'undefined' && result.oldPrice.amount !== result.finalPrice.amount) {
928-
$(this.options.slyOldPriceSelector).show();
929-
} else {
930-
$(this.options.slyOldPriceSelector).hide();
931-
}
928+
isShow = typeof result != 'undefined' && result.oldPrice.amount !== result.finalPrice.amount;
929+
930+
$product.find(this.options.slyOldPriceSelector)[isShow ? 'show' : 'hide']();
932931

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

0 commit comments

Comments
 (0)