Change order status when using Razorpay

The order status is getting changed from pending payment to processing. I want it to go to pending payment to on-hold instead.

I tried this php snippet but it didn’t work.

add_filter( 'woocommerce_pronamic_pay_razorpay_process_payment_order_status', 'change_order_status', 9999, 2 );

function change_order_status( $status, $order ) {
return 'on-hold';

Hello @dkexception

Thanks for liking Knit Pay. Your feedback gives us encouragement to provide you even better services.

You are using wrong filter, kindly try using pronamic_payment_status_update_woocommerce action.

We can also do the customization for you on your behalf, it will be paid service. You can contact us using link below.


This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer