• Resolved jsmalik94

    (@jsmalik94)


    When a customer buys something through our store Woocommerce holds them in the status of pending payment even though they’ve completed payment through PayPal. We only accept PayPal payments. How can I get Woocommerce to automatically move orders into “processing” or more preferably “completed” when the paypal is concluded?

    This is especially an issue because we had previously used Woocommerce’s inventory management. Unfortunately now due to this change, Woocommerce does not deduct inventory until the status has moved to “processing”. This causes us to oversell our inventory and takes away our ability to monitor inventory at a glance.

    Any help would be greatly appreciated, thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • cedcommerce

    (@cedcommerce)

    Hello,

    Thank you for explaining the scenarios,

    As you described, you accept PayPal on your site, the below line of code will always put the order status to completed/ processing, i have mentioned both the conditions, please use any,

    
    add_action( 'woocommerce_thankyou', 'ced_change_order_status' );
    
     
    function ced_change_order_status( $order_id ){
    
       if( ! $order_id ) return;
       $order = wc_get_order( $order_id );
     
       // Status without the "wc-" prefix
      // if want to put in completed state
       $order->update_status( 'completed' );
    
       // if want to put in processing state
       $order->update_status( 'processing' );
    
    } 

    Thanks,

    Mohit Mishra

    (@mohitmishra)

    @jsmalik94 For this we need to check all the code. There is another solution if you want then we can programmatically change the order status of your order to processing or completed. If you want then please let me know. I will provide code to you.

    Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    Hey there!

    The above examples will change the status of the orders, but won’t account for the root issues (which is that the signal from PayPal that the order is paid is not reaching your site).

    This is typically due to IPN communication issues between PayPal and your site.

    We have a whole section in our documentation on how to check for and debug IPN issues on your site using PayPal Standard and WooCommerce: https://docs.woocommerce.com/document/paypal-standard/#section-23

    Work through that, and you should be sorted.

    Hopefully that helps! Have a great one!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Woocommerce holds orders in payment pending even after paypal complete’ is closed to new replies.