• Resolved devpanda

    (@devpanda)


    Hey there!

    Is there a way to specify an individual text for invoices to Switzerland?

    I send my goods from Germany to Switzerland.
    However, I can not charge tax there. And it must be noted with a text on the bill.

    Unfortunately, I have not found a possibility, maybe someone can help me here.

    Greeting
    dev-panda

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! You can do this with an action hook, check out the examples here: Print a custom text after the order details table.

    Here’s a more tailored example that displays on the invoice and only for Switzerland:

    
    add_action( 'wpo_wcpdf_after_order_details', 'wpo_wcpdf_custom_text_switzerland', 10, 2 );
    function wpo_wcpdf_custom_text_switzerland ( $template_type, $order ) {
    	$billing_country = $order->get_billing_country();
    	if ($template_type == 'invoice' && $billing_country == 'CH') {
    		?>
    		<div class="custom-text">
    		No tax charged
    		</div>
    		<?php
    	}
    }
    

    Hope that helps!

    Thread Starter devpanda

    (@devpanda)

    Hey Ewout,

    thanks for the help.
    But I need some more informations.

    Where can I finde this function.php ?
    I’m using WooCommerce and the Germanized plugin.
    There I go bill and to the Customizer. What will happen, when I put the code in the ‘Custom Styles’ field?

    Thread Starter devpanda

    (@devpanda)

    Oh now I understan.
    I’ve to go to the themes -> bulk folder.
    There I find the ‘function.php’.
    Now I’ll add the function there under the rest of the scrips.

    That was all? NICE!

    Thanks a lot.

    Thread Starter devpanda

    (@devpanda)

    Ok. Nothing happend. I really need more help, please.

    Plugin Contributor kluver

    (@kluver)

    Hi @devpanda,

    Here is a guide on how to use an action hook and functions.php: How to use filters

    Hope that helps!

    Thread Starter devpanda

    (@devpanda)

    Thank you!

    Code Snippets was the easiest way to implement the code.

    Plugin Contributor Ewout

    (@pomegranate)

    Very glad to hear that ??

    Have a fantastic day!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Individual text for invoices to Switzerland’ is closed to new replies.