• Resolved shishev

    (@shishev)


    We are trying to integrate WooCommerce with a fulfilment provider’s systems.

    When an order comes into WooCommerce and we mark it as ‘Processing’ it also gets marked as paid.

    And when the API transfers the order details it is marked as 0.00 (paid) at our provider’s systems –?meaning when it gets shipped it will not have a price tag/payment required (COD).

    Our provider told us this should be a setting on WooCommerce somewhere but we don’t know what. We have set all payments as Cash on Delivery with ‘Any Local Pickup Method’.

    Could someone please provide some pointers on what to do in this case?

    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @shishev ,

    So, if I understand correctly the goal is to change the order status to “paid” if the order is placed with a Cash On Delivery method. Is that right?

    Unfortunately, there are no settings for it. However, there is a filter available to allow you to set other order statuses.

    Here is an example code –

    add_filter( 'woocommerce_cod_process_payment_order_status', 'change_cod_payment_order_status', 10, 2 );
    function change_cod_payment_order_status( $order_status, $order ) {
        return 'on-hold';
    }

    The code is taken from this discussion – https://stackoverflow.com/a/53291919

    Let me know if this does help with your application or you were looking for something else.

    Thank you ??

    Thread Starter shishev

    (@shishev)

    Thank you for this — I may not have explained correctly. We need to change the order to unpaid.

    When we receive an order on WooCommerce, our call centre is going to call the customer to confirm the order and it then would get marked as ‘Processing’ which in turn triggers the API and the order shows up at the fulfilment centre ready to be shipped. (hope this makes sense)

    However, when an order gets marked as ‘Processing’ right now, it’s also marked as ‘paid’ and when it shows up at the fulfilment centre there is no monetary value (0.00) because it’s already marked as paid — in other words, we would be sending out orders for free haha.

    I believe the code above is interesting and may be on the right path — not too experienced myself.

    Would there be a way to remove the ‘paid’ status of a ‘Processing’ order?

    Thank you for your help, much appreciated

    Hello @shishev ,

    I am afraid I might not have the full picture here.

    According to the default nature, a processing order status means “Payment received (paid) and the stock has been reduced; order is awaiting fulfillment.”

    So, if there is a situation where you are not taking money during the checkout you will want to mark the order status as “Pending Payment”. For the COD payment method, you can do that using the above example –

    add_filter( 'woocommerce_cod_process_payment_order_status', 'change_cod_payment_order_status', 10, 2 );
    function change_cod_payment_order_status( $order_status, $order ) {
        return 'wc-pending';
    }

    Pending payment means – “Order received, no payment initiated. Awaiting payment (unpaid)” which is your desired outcome according to the description.

    In case you want to modify how processing order status is defined, it might require a significant amount of customization. I can recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    Thank you ??

    Hi there,

    We’ve not heard back from you in a while, so I’m marking this thread as resolved.

    Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

    Thank you ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cash on Delivery marks orders as paid’ is closed to new replies.