When the parent’s order is registered but no payment is made, the order status will be Pending Payment and the subscription status will be pending.
When the renewal order is created, the status of the order will be Pending Payment and the subscription status will be on-hold, But I want the subscription status to be pending.
How can I customize the subscription status according to the order status?
I am using the below code but the status is on-hold and not changing to pending
function change_order_and_subscription_status( $renewal_order, $subscription ) {
$renewal_order->update_status('pending');
$subscription->update_status('pending');
return $renewal_order;
}
add_filter( 'wcs_renewal_order_created', 'change_order_and_subscription_status', 10, 2 );
Can you guide me?