add text by tax
-
Hi, need your help again: I have this code you wrote me some days ago, this code adds a text in the invoice pdfs if the tax calculation equals to zero:
add_action( ‘wpo_wcpdf_after_order_details’, ‘wpo_wcpdf_tax_exempt’, 10, 2 );
function wpo_wcpdf_tax_exempt( $document_type, $order ) {
// only in financial documents
if ( !in_array( $document_type, array(‘invoice’, ‘proforma’, ‘credit-note’) ) ) {
return;
}// check if any tax was charged
if ( $order->get_total_tax() == 0 && $order->get_total() > 0 ) {
?>
<div class=”tax-free”>
TEXT TEXT TEXT TEXT
</div>
<?php
}
}what can I do to make the code do the same thing but by selecting the type of tax and not whit the calculation, I better explain:
if “zero tax” is selected -> html text 1
if “reduced tax” i selected -> html text 2
Thaanks again
- The topic ‘add text by tax’ is closed to new replies.