• Resolved liswa

    (@liswa)


    Is there any way to have “Balance Due: $0.00” or “Paid” or something similar under the total for orders paid for by Credit Card (or just in general even)?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    You can do this with a small code snippet:

    
    add_action( 'wpo_wcpdf_after_order_details', 'wpo_wcpdf_balance_due_paid', 10, 2 );
    function wpo_wcpdf_balance_due_paid( $template_type, $order ) {
    	if ( $order->is_paid() ) {
    		?>
    		<div style="float:right;">
    			Balance due: <strong>$0.00</strong>
    		</div>
    		<?php
    	}
    }
    

    or a somewhat more fancy looking ‘PAID’ label:

    
    add_action( 'wpo_wcpdf_after_order_details', 'wpo_wcpdf_balance_due_paid', 10, 2 );
    function wpo_wcpdf_balance_due_paid( $template_type, $order ) {
    	if ( $order->is_paid() ) {
    		?>
    		<div style="float:right; display:inline-block; color:white !important; background-color:green; padding:2mm; border-radius:1mm; font-weight:bold !important; clear:both;">
    			PAID
    		</div>
    		<?php
    	}
    }
    

    If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters

    Thread Starter liswa

    (@liswa)

    Brilliant, thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Balance due option’ is closed to new replies.