piffpaffpuff/woocommerce-delivery-notes — pull request #2 by welovewordpress (2012-05-07 21:47:16+00:00)
Title: added prices with tax, taxrate and full item array to pass to template

Hi again,

I added some more fields to the $items array sent to the template. Mostly prices with taxes and taxrate, which you might or might not regard as useful, but please include at least the last line of these:

// Get item tax rate
$data['taxrate'] = $item['taxrate'];

// Get line total price including tax
$data['price_with_tax'] = woocommerce_price( ( $item['line_total'] + $item['line_tax'] ), array( 'ex_tax_label' => 0 ) );

// Get single item price including tax
$data['single_price_with_tax'] = woocommerce_price( ( $item['line_total'] + $item['line_tax'] ) / $item['qty'], array( 'ex_tax_label' => 0 ) );

// Pass complete item array - more freedom for template developers
$data['item'] = $item;

If you include the whole $item object (array) in the $data that gets passed to the template, it will be much easier for a template developer, to implement things like prices with taxes by themselves - directly in the template.

Thanks in advance,

Matt