@@ -140,7 +140,11 @@ public function maybe_init_subscriptions() {
140
140
add_filter ( 'woocommerce_my_subscriptions_payment_method ' , [ $ this , 'maybe_render_subscription_payment_method ' ], 10 , 2 );
141
141
142
142
// Used to filter out unwanted metadata on new renewal orders.
143
- add_filter ( 'wcs_renewal_order_meta_query ' , [ $ this , 'update_renewal_meta_data ' ], 10 , 3 );
143
+ if ( ! class_exists ( 'WC_Subscriptions_Data_Copier ' ) ) {
144
+ add_filter ( 'wcs_renewal_order_meta_query ' , [ $ this , 'update_renewal_meta_data ' ], 10 , 3 );
145
+ } else {
146
+ add_filter ( 'wc_subscriptions_renewal_order_data ' , [ $ this , 'remove_data_renewal_order ' ], 10 , 3 );
147
+ }
144
148
145
149
// Allow store managers to manually set Stripe as the payment method on a subscription.
146
150
add_filter ( 'woocommerce_subscription_payment_meta ' , [ $ this , 'add_subscription_payment_meta ' ], 10 , 2 );
@@ -733,6 +737,18 @@ public function update_renewal_meta_data( $order_meta_query, $to_order, $from_or
733
737
return $ order_meta_query ;
734
738
}
735
739
740
+ /**
741
+ * Removes the data that we don't need to copy to renewal orders.
742
+ *
743
+ * @param array $order_data Renewal order data.
744
+ *
745
+ * @return array The renewal order data with the data we don't want copied removed
746
+ */
747
+ public function remove_data_renewal_order ( $ order_data ) {
748
+ unset( $ order_data ['_new_order_tracking_complete ' ] );
749
+ return $ order_data ;
750
+ }
751
+
736
752
/**
737
753
* Adds the failed SCA auth email to WooCommerce.
738
754
*
0 commit comments