File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,6 @@ var config = {
11
11
relatedProducts : 'Magento_Catalog/js/related-products' ,
12
12
upsellProducts : 'Magento_Catalog/js/upsell-products' ,
13
13
productListToolbarForm : 'Magento_Catalog/js/product/list/toolbar' ,
14
- tierPrice : 'Magento_Catalog/js/tier-price' ,
15
- addToCart : 'Magento_Msrp/js/msrp' ,
16
14
catalogGallery : 'Magento_Catalog/js/gallery' ,
17
15
priceBox : 'Magento_Catalog/js/price-box' ,
18
16
priceOptionDate : 'Magento_Catalog/js/price-option-date' ,
Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ define([
66
66
67
67
this . popupDOM = $ ( this . options . popUpAttr ) [ 0 ] ;
68
68
this . infoPopupDOM = $ ( '[data-role=msrp-info-template]' ) [ 0 ] ;
69
+ $ ( this . options . cartButtonId ) . on ( 'click' , this . _addToCartSubmit . bind ( this ) ) ;
69
70
70
71
if ( this . options . popupId ) {
71
72
$ ( 'body' ) . append ( $ ( this . popupDOM ) . html ( ) ) ;
@@ -137,6 +138,29 @@ define([
137
138
closePopup : function ( $elem ) {
138
139
$elem . dropdownDialog ( 'close' ) ;
139
140
$ ( document ) . off ( 'mouseup' ) ;
141
+ } ,
142
+
143
+ /**
144
+ * Handler for addToCart action
145
+ */
146
+ _addToCartSubmit : function ( ) {
147
+ this . element . trigger ( 'addToCart' , this . element ) ;
148
+
149
+ if ( this . element . data ( 'stop-processing' ) ) {
150
+ return false ;
151
+ }
152
+
153
+ if ( this . options . addToCartButton ) {
154
+ $ ( this . options . addToCartButton ) . click ( ) ;
155
+
156
+ return false ;
157
+ }
158
+
159
+ if ( this . options . addToCartUrl ) {
160
+ $ ( '.mage-dropdown-dialog > .ui-dialog-content' ) . dropdownDialog ( 'close' ) ;
161
+ }
162
+ $ ( this . options . cartForm ) . submit ( ) ;
163
+
140
164
}
141
165
} ) ;
142
166
You can’t perform that action at this time.
0 commit comments