Plugin Contributor
Ewout
(@pomegranate)
Hi! Do by ‘customer’, do you mean the shop manager? Or are you talking about the My Account buttons?
Plugin Contributor
Ewout
(@pomegranate)
Check the code snippet in this post:
https://ww.wp.xz.cn/support/topic/invoice-is-generated-also-with-a-not-confirmend-order/#post-7545411
Adapted to hide the packing-slip as well and updated for WC3.0:
/**
* Remove invoice button if order is not completed
*/
add_filter( 'wpo_wcpdf_listing_actions', 'wpo_wcpdf_restrict_invoice_button', 20, 2 );
add_filter( 'wpo_wcpdf_meta_box_actions', 'wpo_wcpdf_restrict_invoice_button', 20, 1 );
function wpo_wcpdf_restrict_invoice_button ($actions, $order = '' ) {
if (empty($order)) {
global $post_id;
$order = wc_get_order( $post_id );
}
if ($order->get_status() != 'completed') {
unset($actions['invoice']);
unset($actions['packing-slip']);
}
return $actions;
}
Let me know if you have any other questions!
Ewout
Hi,
thankyou it’s working nice.
i have another doubt if choose bacs payment gateway order id doesn’t create it’s possible to do it.