• Hi,

    I have 3 different tax rate (23% / 8% / 5%) and I’d like to show that on the receipt like this:

    ——
    Product Name 1 : Tax Category A
    Qty.1 x Cost$— $—(Price including tax)

    Product Name 2 : Tax Category B
    Qty.1 x Cost$— $—(Price including tax)

    Product Name 3 : Tax Category C
    Qty.1 x Cost$— $—(Price including tax)

    —–

    TAX A $–
    TAX B $–
    TAX C $–

    TAX TOTAL $A+B+C
    TOTAL $—(Price shown including tax)

    —–

    What strings should I add to my PHP file?

    • This topic was modified 3 years, 8 months ago by ckwroebrw.
Viewing 6 replies - 1 through 6 (of 6 total)
  • try this one

    Shipping Tax – $printer->add_text_line(“Shipping Tax: “.star_cloudprnt_get_codepage_currency_symbol().$order->get_shipping_tax());

    Im not 100% sure but maybe its work .

    Plugin Contributor Guillermo Cubero

    (@gcubero)

    Hi @kahobak

    I’m looking into this. It should be possible to get the tax class using the WooCommerce API. I’ll update once I have more info.

    Thread Starter ckwroebrw

    (@kahobak)

    try this one

    Shipping Tax – $printer->add_text_line(“Shipping Tax: “.star_cloudprnt_get_codepage_currency_symbol().$order->get_shipping_tax());

    Im not 100% sure but maybe its work .

    Unfortunately this didn’t work ;(

    Thread Starter ckwroebrw

    (@kahobak)

    Thank you @gcubero ??

    Hi @kahobak

    I’m looking into this. It should be possible to get the tax class using the WooCommerce API. I’ll update once I have more info.

    Hi any update on how to add the tax fields in these receipts? Thanks.

    Plugin Contributor Guillermo Cubero

    (@gcubero)

    Here’s an example:
    These mods are all based on the 2.0.3 release:

    1. In the function named star_cloudprnt_print_items, at around line 65 find:
    //$product_info .= " Tax Class: " . $item_data->get_tax_class();

    And remove the // at the beginning to uncomment it.
    This will print the tax class of each item. One caveat is WooCommerce returns an empty string for the default tax class, but it’s a good starting point.

    2. In the function named star_cloudprnt_print_item_totals
    Find the line, near the end of the function that prints the receipt TOTAL:
    $ft("TOTAL", $order_meta['_order_total'][0]);

    above that line, add this code:

    $taxes = $order->get_tax_totals();
    foreach ($taxes as $tax)
    {
     $ft("TAX: " . $tax->label, $tax->amount);
    }
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Show tax in receipt.’ is closed to new replies.