File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
app/code/Magento/Checkout/view/frontend/web/js/cart Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ define([
2222 if ( ! text ) {
2323 return NaN ;
2424 }
25+
2526 // Remove non-numeric except . , - then normalize
2627 let cleaned = ( '' + text ) . replace ( / [ ^ 0 - 9 , . - ] / g, '' ) ;
2728
@@ -32,6 +33,7 @@ define([
3233 // European format: swap , to .
3334 cleaned = cleaned . replace ( / , / g, '.' ) ;
3435 }
36+
3537 const n = parseFloat ( cleaned ) ;
3638
3739 return isNaN ( n ) ? NaN : Math . round ( n * 100 ) / 100 ;
@@ -49,6 +51,7 @@ define([
4951 sum += val ;
5052 }
5153 } ) ;
54+
5255 return Math . round ( sum * 100 ) / 100 ;
5356 }
5457
@@ -65,10 +68,12 @@ define([
6568 if ( clicked ) {
6669 return ;
6770 }
71+
6872 const central = getCentralSubtotal ( ) , summary = getSummarySubtotal ( ) ;
69-
73+
7074 if ( ! isNaN ( central ) && ! isNaN ( summary ) && central !== summary ) {
7175 const $updateBtn = $root . find ( '.cart.main.actions button.action.update' ) ;
76+
7277 if ( $updateBtn . length ) {
7378 clicked = true ;
7479 $updateBtn . trigger ( 'click' ) ;
You can’t perform that action at this time.
0 commit comments