Executing a hook after creating a subscription

24 Views Asked by At

I use plugin WooCommerce Subscribtion. I need run this code after create subscription I need change order status to completed after payment and create subscription


function custom_autocomplete_order($order_id)
{

if($order_id) {
        $order = wc_get_order($order_id);
        $order->update_status('completed');
}
} 
 add_action( 'woocommerce_order_status_processing', 'custom_autocomplete_order' );

0

There are 0 best solutions below