PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, February 5, 2022

[FIXED] WooCommerce order status change from payment gateway

 February 05, 2022     orders, payment-gateway, php, woocommerce, wordpress     No comments   

Issue

I have integrated a payment gateway to accept online payments for my store running on woocommerce. Everything works fine but I noticed that woocommerce is changing the order status to wc-processing for all the online paid orders by default.

As per my store's functionality I want all the online paid orders to be in wc-on-hold status initially.

Is there any way to stop woocommerce changing the order status to wc-processing programatically?


Solution

yes there is a way, but you need to modify the payment plugin or add your own code, you can read this to understand how payments work.

Now, woocommerce use $order->payment_complete() method to handle the completed order, so you need to hook your own function to modify the status, here is the description of that method

Use this filter: woocommerce_payment_complete_order_status



Answered By - Mauro
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing