File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
app/code/Magento/Swatches/view/frontend/web/js Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments