File tree 3 files changed +27
-2
lines changed
system/modules/isotope/library/Isotope
3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,16 @@ public function generate()
116
116
$ objWidget ->validate ();
117
117
118
118
if (!$ objWidget ->hasErrors ()) {
119
- Isotope::getCart ()->setPaymentMethod ($ this ->modules [$ objWidget ->value ]);
119
+ $ objPayment = $ this ->modules [$ objWidget ->value ];
120
+
121
+ // !HOOK: checkout payment
122
+ if (isset ($ GLOBALS ['ISO_HOOKS ' ]['checkoutPayment ' ]) && \is_array ($ GLOBALS ['ISO_HOOKS ' ]['checkoutPayment ' ])) {
123
+ foreach ($ GLOBALS ['ISO_HOOKS ' ]['checkoutPayment ' ] as $ callback ) {
124
+ $ objPayment = System::importStatic ($ callback [0 ])->{$ callback [1 ]}($ objPayment , Isotope::getCart ());
125
+ }
126
+ }
127
+
128
+ Isotope::getCart ()->setPaymentMethod ($ objPayment );
120
129
}
121
130
}
122
131
Original file line number Diff line number Diff line change @@ -118,7 +118,16 @@ public function generate()
118
118
$ objWidget ->validate ();
119
119
120
120
if (!$ objWidget ->hasErrors ()) {
121
- Isotope::getCart ()->setShippingMethod ($ this ->modules [$ objWidget ->value ]);
121
+ $ objShipping = $ this ->modules [$ objWidget ->value ];
122
+
123
+ // !HOOK: checkout shipping
124
+ if (isset ($ GLOBALS ['ISO_HOOKS ' ]['checkoutShipping ' ]) && \is_array ($ GLOBALS ['ISO_HOOKS ' ]['checkoutShipping ' ])) {
125
+ foreach ($ GLOBALS ['ISO_HOOKS ' ]['checkoutShipping ' ] as $ callback ) {
126
+ $ objShipping = System::importStatic ($ callback [0 ])->{$ callback [1 ]}($ objShipping , Isotope::getCart ());
127
+ }
128
+ }
129
+
130
+ Isotope::getCart ()->setShippingMethod ($ objShipping );
122
131
}
123
132
}
124
133
Original file line number Diff line number Diff line change @@ -260,6 +260,13 @@ public function complete()
260
260
$ objCart ->config_id = $ this ->config_id ;
261
261
}
262
262
263
+ // !HOOK: complete checkout
264
+ if (isset ($ GLOBALS ['ISO_HOOKS ' ]['checkoutComplete ' ]) && \is_array ($ GLOBALS ['ISO_HOOKS ' ]['checkoutComplete ' ])) {
265
+ foreach ($ GLOBALS ['ISO_HOOKS ' ]['checkoutComplete ' ] as $ callback ) {
266
+ System::importStatic ($ callback [0 ])->{$ callback [1 ]}($ this );
267
+ }
268
+ }
269
+
263
270
return true ;
264
271
}
265
272
You can’t perform that action at this time.
0 commit comments