Support » Plugin: WooCommerce PDF Invoices & Packing Slips » function get_order_subtotal doesn't remove "excl. tax"

  • Resolved Mystikal91

    (@mystikal91)


    I noticed that the function get_order_subtotal tries to remove the “excl. tax” on the price, but it fails.

    The reason is that the function get_subtotal_to_display() adds ‘ <small class=”tax_label”>’ in this part of code:

    if ( $tax_display == 'excl' && $this->prices_include_tax ) {
            $subtotal .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';
          }

    while get_order_subtotal tries to remove it searching for ‘ <small>’ in the string, in this piece of code:
    $subtotal = ($pos = strpos($subtotal, ' <small>')) ? substr($subtotal, 0, $pos) : $subtotal; //removing the 'excluding tax' text

    I fixed it changing it to:
    $subtotal = ($pos = strpos($subtotal, 'small')) ? substr($subtotal, 0, $pos) : $subtotal; //removing the 'excluding tax' text

    Can you solve it too in a stable release?

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

Viewing 1 replies (of 1 total)
  • Plugin Author Ewout

    (@pomegranate)

    Thanks for the suggestion! I have added this fix to the development branch and will push this with the next official release, with one small change, searching for <small instead of small.

    Thanks a lot – much appreciated input!

    Ewout

Viewing 1 replies (of 1 total)
  • The topic ‘function get_order_subtotal doesn't remove "excl. tax"’ is closed to new replies.