File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
app/code/Magento/Wishlist/view/frontend/web/js Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ define([
25
25
/** @inheritdoc */
26
26
_create : function ( ) {
27
27
this . _bind ( ) ;
28
+ this . _triggerWishlistFormUpdate ( ) ;
28
29
} ,
29
30
30
31
/**
@@ -58,16 +59,22 @@ define([
58
59
}
59
60
}
60
61
this . _on ( events ) ;
61
- this . _ready ( ) ;
62
62
} ,
63
63
64
64
/**
65
- * Update wishlist on page load
65
+ * Update wishlist on page load and before submit
66
66
*
67
67
* @private
68
68
*/
69
- _ready : function ( ) {
69
+ _triggerWishlistFormUpdate : function ( ) {
70
+ var key ;
71
+
70
72
$ ( this . options . qtyInfo ) . trigger ( 'change' ) ;
73
+ for ( key in this . options . productType ) {
74
+ if ( this . options . productType . hasOwnProperty ( key ) && this . options . productType [ key ] + 'Info' in this . options ) {
75
+ $ ( this . options [ this . options . productType [ key ] + 'Info' ] ) . trigger ( 'change' ) ;
76
+ }
77
+ }
71
78
} ,
72
79
73
80
/**
@@ -277,6 +284,8 @@ define([
277
284
_validateWishlistQty : function ( event ) {
278
285
var element = $ ( this . options . qtyInfo ) ;
279
286
287
+ this . _triggerWishlistFormUpdate ( ) ;
288
+
280
289
if ( ! ( element . validation ( ) && element . validation ( 'isValid' ) ) ) {
281
290
event . preventDefault ( ) ;
282
291
event . stopPropagation ( ) ;
You can’t perform that action at this time.
0 commit comments