Hi, Ewout!
I’m very grateful for Your answer, it helped! In the end made something like this
add_filter( 'wpo_wcpdf_woocommerce_totals', 'wpo_wcpdf_woocommerce_totals_custom', 10, 2);
function wpo_wcpdf_woocommerce_totals_custom( $totals, $order) {
$totals = array(
'price_without_vat' => array(
'label' => __('Price without VAT', 'wpo_wcpdf'),
'value' => wc_price( $order->get_total() - $order->get_total_tax(), array( 'currency' => WPO_WCPDF()->export->order->get_order_currency() ) ),
),
'order_shipping' => array(
'label' => __('Shipping', 'arga-custom'),
//Can't find the function/variable to show shipping AND/OR is shipping even selected
'value' => '',
),
'total_tax' => array(
'label' => __('Total tax', 'wpo_wcpdf'),
'value' => wc_price( WPO_WCPDF()->export->order->get_total_tax() - WPO_WCPDF()->export->order->get_total_tax_refunded(), array( 'currency' => WPO_WCPDF()->export->order->get_order_currency() ) ),
),
'total_price' => array(
'label' => __('Total price', 'wpo_wcpdf'),
'value' => wc_price( $order->get_total(), array( 'currency' => WPO_WCPDF()->export->order->get_order_currency() ) ),
),
// etc.
);
return $totals;
}
but there is problem with shipping, somehow I can’t understand how to show shipping (if shipping even is selected).
Tried adding get_order_shipping + changing add_filter to accept 3 variables and adding $tax variable, but it didn’t work.