Mark invoice as paid for “processing” order
-
Hi,
1) Code for both completed and processing orders:
I was reading the previous post here: https://wordpress.org/support/topic/mark-invoice-as-paid-or-not-paid/
The code to add “- PAID” works great for “completed” orders. Would it be possible to modify it so that it works for EITHER “completed” or “processing” orders? I tried to modify it myself but without success 🙁
This is the code:
add_action( ‘wpo_wcpdf_after_document_label’, ‘wpo_wcpdf_paid_label’, 10, 2 );
function wpo_wcpdf_paid_label( $template_type, $order ) {
if ( $order->get_status() == ‘completed’ && $template_type == ‘invoice’ ) {
?>
<style type=”text/css”>
.document-type-label::after { content: ” – PAID”; }
</style>
<?php
}
}2) In the same previous post you also shared the code to display a picture when the order is “complete” as follow:
add_action( ‘wpo_wcpdf_before_document’, ‘wpo_wcpdf_paid_label’, 10, 2 );
function wpo_wcpdf_paid_label( $template_type, $order ) {
if ( $order->get_status() == ‘completed’ && $template_type == ‘invoice’ ) {
?>

<?php
}
}– I replaced http://wpovernight.com/dont_print_emails.jpg
with /www/tripusafrance_204/public/wp-content/themes/tesseract-free-theme/images/invoicepaid.jpg which is where my picture is located on my server.
– I copied the code in my function.php fileBut it makes my website crash and tells me that there is a “critical error” Do you have any idea why this code does not work?
Many thanks,
Julia
The topic ‘Mark invoice as paid for “processing” order’ is closed to new replies.