Last active
August 31, 2025 06:20
-
-
Save webdados/d5824d91f925400552b3ff4dd3102287 to your computer and use it in GitHub Desktop.
Automatically issue proforma invoice when order is on-hold (newly created).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Automatically issue proforma invoice when order is on-hold (newly created). | |
* https://invoicewoo.com/ | |
* https://nakedcatplugins.com/product/invoicing-with-invoicexpress-for-woocommerce-pro/ | |
*/ | |
add_action( | |
// When the order is created via the checkout | |
'woocommerce_order_status_on-hold', | |
function( $order_id ) { | |
$order = wc_get_order( $order_id ); | |
// If the payment method is "Bank Transfer" | |
if ( $order->get_payment_method() === 'bacs' ) { | |
// Do something for BACS payment | |
$order->add_order_note( 'BACS payment detected - Issue proforma invoice automatically' ); | |
do_action( 'woocommerce_order_action_hd_wc_ie_plus_generate_proforma', $order, 'automatic' ); | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment