@@ -53,17 +53,19 @@ public static function init() {
53
53
add_action ( 'woocommerce_order_needs_payment ' , array ( __CLASS__ , 'order_does_not_need_payment ' ), 10 , 2 );
54
54
add_action ( 'woocommerce_get_checkout_order_received_url ' , array ( __CLASS__ , 'change_order_received_url ' ), 10 , 2 );
55
55
add_action ( 'woocommerce_store_api_checkout_order_processed ' , array ( __CLASS__ , 'process_request ' ) );
56
- //woocommerce_order_item_quantity -- dont reserve stock for this order.
57
- //woocommerce_get_checkout_order_received_url --- change the order's redirect URL to send the customer back to the subscription page.
58
56
59
- //add_filter( 'woocommerce_enqueue_styles', array( __CLASS__, 'enqueue_styles' ), 100, 1 );
60
57
add_action ( 'wp_enqueue_scripts ' , [ __CLASS__ , 'register_scripts ' ] );
61
58
62
59
add_filter ( 'woocommerce_order_button_text ' , array ( __CLASS__ , 'order_button_text ' ) );
63
60
64
- add_action ( 'woocommerce_subscription_payment_complete ' , function ( $ subscription ) {
65
- error_log ('RUNNING woocommerce_subscription_payment_complete ' );
66
- } );
61
+ add_action (
62
+ 'woocommerce_subscription_payment_complete ' ,
63
+ function (
64
+ $ subscription
65
+ ) {
66
+ error_log ( 'RUNNING woocommerce_subscription_payment_complete ' );
67
+ }
68
+ );
67
69
}
68
70
69
71
/**
@@ -178,18 +180,18 @@ public static function maybe_add_subscription_to_cart_for_address_change() {
178
180
public static function crumbs_for_address_change ( $ crumbs ) {
179
181
180
182
if ( ! is_main_query () && ! is_page () && ! is_checkout () ) {
181
- error_log (1 );
183
+ error_log ( 1 );
182
184
return $ crumbs ;
183
185
}
184
186
185
187
if ( ! isset ( $ _GET ['update_subscription_address ' ] ) && ! self ::cart_contains_change_address_request () ) {
186
- error_log (2 );
188
+ error_log ( 2 );
187
189
return $ crumbs ;
188
190
}
189
191
190
192
if ( isset ( $ _GET ['update_subscription_address ' ] ) ) {
191
193
$ subscription = wcs_get_subscription ( absint ( $ _GET ['update_subscription_address ' ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
192
- } else {
194
+ } else {
193
195
$ subscription = self ::get_subscription_from_cart ();
194
196
}
195
197
0 commit comments