Home > Blockchain >  Setting custom order statuses as paid in WooCommerce
Setting custom order statuses as paid in WooCommerce

Time:09-30

I have a custom status that I need to set as 'paid', in the same sense that the core statuses Processing and Complete are 'paid' statuses.

I need to do this because WC is synced to accounting software, and the sync is unable to generate a sales receipt for an unpaid order. It works fine when using Complete or Processing statuses, but not for my custom status.

I'm using enter image description here

Hoping somebody can help me!

CodePudding user response:

What @Martin said. You have this available:

apply_filters( 'woocommerce_order_is_paid_statuses', array( 'processing', 'completed' ) );

So, you can add to it with add_filter():

add_filter( 'woocommerce_order_is_paid_statuses', 'bbloomer_paid_is_paid_status' );

function bbloomer_paid_is_paid_status( $statuses ) {
   $statuses[] = 'paid';
   return $statuses;
}
  • Related