WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce Print Invoice & Delivery Note
[resolved] Change "Invoice" to "Tax Invoice" (9 posts)

  1. clothncraft
    Member
    Posted 1 year ago #

    Hi!
    I was just wondering if it would be possible to put some code in my theme's functions file to change the text "Invoice" on the invoice page to "Tax Invoice"?
    I've tried playing around myself but I'm NOT a coder and to put it bluntly - it didn't work! Any help would be GREATLY appreciated!

    Thanks!

    http://wordpress.org/extend/plugins/woocommerce-delivery-notes/

  2. Toherangi
    Member
    Posted 1 year ago #

    This can be done but there are quite a few steps involved, also, if you upgrade the plugin at any stage in the future, you will lose these changes and have to repeat the procedure again.

    1) Login to your WordPress Dashboard and go to Plugins > Editor.

    2) Choose WooCommerce Print Invoices & Delivery Notes from the Select plugin to edit: dropdown menu at the top right and click Select.

    3) Click on woocommerce-delivery-notes/woocommerce-delivery-notes.php under the heading Plugin Files on the right side of the page.

    4) Locate the following lines in the file. You can do this just by scrolling down inside the editor box, or by doing a search (CTRL + F for Windows or CMD + F for Mac) on your browser and using Show the template title depending on type as the search term.

    /**
     * Show the template title depending on type
     */

    5) Approx 4 lines under this heading you will find this line of code:

    echo apply_filters( 'wcdn_template_title', __( 'Invoice', 'woocommerce-delivery-notes' ) );

    6) Change the word Invoice to Tax Invoice like this:

    echo apply_filters( 'wcdn_template_title', __( 'Tax Invoice', 'woocommerce-delivery-notes' ) );

    7) Click on the blue Update File button underneath the editor box.

    8) Make sure you get the yellow File edited successfully banner at the top of the page and you are all set!

    Let me know how you go!

  3. piffpaffpuff
    Member
    Plugin Author

    Posted 1 year ago #

    @Toherangi thanks for your help, but i think that editing source files isn't very update-proof. i think the following should work instead (not tested but should work): just add the code below to your theme functions.php.

    function change_invoice_title($title) {
    return 'Tax invoice';
    }
    add_filter('wcdn_template_title', 'change_invoice_title');
  4. Toherangi
    Member
    Posted 1 year ago #

    Yes, I did advise such. It was really just a stopgap solution.
    Won't functions.php also be overwritten on a theme update?

  5. clothncraft
    Member
    Posted 1 year ago #

    Well a functions file won't get overwritten if I'm using a child theme... which I am so it might just do the trick! I'll give it a go now.

  6. clothncraft
    Member
    Posted 1 year ago #

    It worked! You so totally ROCK! Thanks heaps!

  7. Toherangi
    Member
    Posted 1 year ago #

    Well done on using the child theme, always the best way to go.
    Many people don't so I didn't want to assume.

    Glad it worked for you.

  8. melanie71
    Member
    Posted 12 months ago #

    Just wondering whether there will ever be an easier way to achieve this change? Having 'Tax Invoice' printed on the top of invoices is something that almost all Australian businesses need to do to comply with Federal Government Taxation requirements. If there is any way this could be worked into an update of this plugin we would be forever grateful!

  9. Nealeb
    Member
    Posted 11 months ago #

    I'll give the suggestions a go as well.

    Thanks for the instructions.

    Just like to agree with Melanie71 it is a tax requirement in Australia to include the words Tax Invoice - also need to quote our ABN (Australian Business Number).

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic