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 @@ -902,7 +902,8 @@ define([
902
902
$productPrice = $product . find ( this . options . selectorProductPrice ) ,
903
903
options = _ . object ( _ . keys ( $widget . optionsMap ) , { } ) ,
904
904
result ,
905
- tierPriceHtml ;
905
+ tierPriceHtml ,
906
+ isShow ;
906
907
907
908
$widget . element . find ( '.' + $widget . options . classes . attributeClass + '[option-selected]' ) . each ( function ( ) {
908
909
var attributeId = $ ( this ) . attr ( 'attribute-id' ) ;
@@ -919,11 +920,9 @@ define([
919
920
}
920
921
) ;
921
922
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' ] ( ) ;
927
926
928
927
if ( typeof result != 'undefined' && result . tierPrices . length ) {
929
928
if ( this . options . tierPriceTemplate ) {
You can’t perform that action at this time.
0 commit comments