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([
924
924
$productPrice = $product . find ( this . options . selectorProductPrice ) ,
925
925
options = _ . object ( _ . keys ( $widget . optionsMap ) , { } ) ,
926
926
result ,
927
- tierPriceHtml ;
927
+ tierPriceHtml ,
928
+ isShow ;
928
929
929
930
$widget . element . find ( '.' + $widget . options . classes . attributeClass + '[option-selected]' ) . each ( function ( ) {
930
931
var attributeId = $ ( this ) . attr ( 'attribute-id' ) ;
@@ -941,11 +942,9 @@ define([
941
942
}
942
943
) ;
943
944
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' ] ( ) ;
949
948
950
949
if ( typeof result != 'undefined' && result . tierPrices . length ) {
951
950
if ( this . options . tierPriceTemplate ) {
You can’t perform that action at this time.
0 commit comments