WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce PDF Invoices & Packing Slips
[resolved] Order total for different tax classes (2 posts)

  1. indira14
    Member
    Posted 5 months ago #

    Hi! Hoping you can help me find a way to do the following:

    I would like the order total show on my pdf invoices like in the following example:

    [Order with products of 6% tax and 21% tax]

    Order total excluding tax: €100
    Tax 21%: €50 (€10.50)
    Tax 6%: €50 (€3.00)
    --
    Order total including tax: €113.50

    Can you help me get there?

    https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/

  2. Ewout
    Member
    Plugin Author

    Posted 5 months ago #

    Hi Indira,
    You can get the tax classes in an array like this: $taxes = $wpo_wcpdf->get_order_taxes()

    you can then print these in a table by getting their respective labels & value:

    foreach( $taxes as $tax ) :
    	?>
    	<tr>
    		<th><?php echo $tax['label']; ?></td>
    		<td><?php echo $tax['value']; ?></td>
    	</tr>
    	<?php
    endforeach;

    You can get the grand total including tax with: $wpo_wcpdf->order_grand_total('incl')

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.