Skip to content

Commit

Permalink
Replace the use of deprecated hook wcs_renewal_order_meta with `wc_…
Browse files Browse the repository at this point in the history
…subscriptions_renewal_order_data`
  • Loading branch information
iamdharmesh committed Jul 25, 2024
1 parent ef3f984 commit 8691d13
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function add_support() {
add_filter( 'woocommerce_my_subscriptions_payment_method', array( $this, 'maybe_render_payment_method' ), 10, 3 );

// don't copy over order-specific meta to the WC_Subscription object during renewal processing
add_filter( 'wcs_renewal_order_meta', array( $this, 'do_not_copy_order_meta' ) );
add_filter( 'wc_subscriptions_renewal_order_data', array( $this, 'do_not_copy_order_meta' ) );

// process the Change Payment "transaction"
add_filter( 'wc_payment_gateway_' . $this->get_gateway()->get_id() . '_process_payment', array( $this, 'process_change_payment' ), 10, 3 );
Expand Down Expand Up @@ -304,10 +304,9 @@ public function do_not_copy_order_meta( $order_meta ) {

$meta_keys = $this->get_order_specific_meta_keys();

foreach ( $order_meta as $index => $meta ) {

if ( in_array( $meta['meta_key'], $meta_keys, true ) ) {
unset( $order_meta[ $index ] );
foreach ( $meta_keys as $meta_key ) {
if ( isset( $order_meta[ $meta_key ] ) ) {
unset( $order_meta[ $meta_key ] );
}
}

Expand Down

0 comments on commit 8691d13

Please sign in to comment.