outmaster
Forum Replies Created
-
Hello again
I have figured out a way.
<?php $num1 = $order->get_subtotal(); $num2 = $order->get_total_tax(); $num3 = 100; $num4 = 7; echo number_format( $num1 - ($num2 * $num3 / $num4) , 2); ?>Thanks for the great plugin.
Hello!
I have already purchased a Premium Templates extension. Everything works very well. But I would like to ask one more thing.
I have 2 types of web product tax forms:
1.VAT 0%
2.VAT 7%What if I want to separate the total price of all products under VAT 0% (excluding VAT 7% group) to be displayed in the TOTALS field? Do you have any advice?
Thank you
I tried this, now it works as I want.
<td> <?php do_action( 'custom_amount_in_words', $this->type, $this->order ); ?> </td>and
add_action ( 'custom_amount_in_words', 'wpo_wcpdf_spell_out_total', 10, 2); function wpo_wcpdf_spell_out_total ($template_type, $order) { if ( in_array( $template_type, array( 'invoice', 'credit-note' ) ) ) { $f = new NumberFormatter("en", NumberFormatter::SPELLOUT); $spelled_out_total = $f->format($order->get_total()); echo "<p><strong>Amount in words:</strong><br>" . $spelled_out_total . "</p>"; } }Thank you so much
Thanks for the advice
I put your example in the theme’s functions.php, It works
But now I have created HTML fields for signing at the end of Invoice.
That makes the total amount in words not in the desired position.
If I am converting from your sample filter to PHP, put it in the invoice template, what do I do?