Support » Plugin: WooCommerce PDF Invoices & Packing Slips » Add shortcode inc_price to be used within PDF template

  • Resolved magicsun

    (@magicsun)


    Hi there,

    Great plugin! Really suitable for my client needs.

    In a previous thread within this support forum, I found out about the variations that can be used within the PDF template invoice.php to add different data to the PDF.

    I need the options “including tax” of the price, single_price etc. You have ex_price, ex_single_price but no including tax equivalent of it.

    Right now i’ve “fixed” it by adding this myself to the include class-wcpdf-export.php file:

    $data['inc_price'] = $this->get_formatted_item_price ( $item, 'total', 'incl' );

    But my question is: is there any way these can be included within the plugin, or that I can include them by a function, rather than editing the include file? Because of any future updates .. I rather not edit the plugin files.

    Many thanks!

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ewout

    (@pomegranate)

    Hi! This is actually already included! All the prices without the ex_ prefix are including tax 🙂

    Hope that helps!
    Ewout

    Not really, order_price is used within the invoice.php template, which refers to:

    $data['order_price'] = $this->order->get_formatted_line_subtotal( $item ); // formatted according to WC settings

    “Formatted according to WC settings” so if basket/checkout is set to excluding tax, the prices are not displayed including, but excluding tax. But I need the prices to be including in the invoice (yeah doesn’t make sense, I know)

    The code works, but only if setting is “including”. It doesn’t ‘force’ the price to be including no matter what the settings are.

    Plugin Author Ewout

    (@pomegranate)

    Hi! The ‘order_price’ is just an extra price, always a duplicate of either of the other prices Ignore ‘order_price’ and you’ll see that each price has it’s ex_ equivalent and is including tax by default :).

    Ewout

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add shortcode inc_price to be used within PDF template’ is closed to new replies.