• Resolved tjos123

    (@tjos123)


    Hi. Can you please share how to display country by default in the invoice and packing slips? For both billing and shipping address. Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @tjos123,

    Add this code snippet to your site to do so:

    /**
     * Show the billing/shipping country on documents
     */
    add_action( 'wpo_wcpdf_after_billing_address', 'wpo_wcpdf_show_billing_country', 10, 2 );
    add_action( 'wpo_wcpdf_after_shipping_address', 'wpo_wcpdf_show_shipping_country', 10, 2 );
    function wpo_wcpdf_show_billing_country( $template_type, $order ){
    	$shipping_country = WC()->countries->countries[ $order->get_billing_country() ];
    	echo '<div>' . $shipping_country . '</div>';
    }
    function wpo_wcpdf_show_shipping_country( $template_type, $order ){
    	$billing_country = WC()->countries->countries[ $order->get_shipping_country() ];
    	echo '<div>' . $billing_country . '</div>';
    }
    Thread Starter tjos123

    (@tjos123)

    Thanks @yordansoares. Is it possible to let the country be displayed above the postal code?

    Thread Starter tjos123

    (@tjos123)

    Or rather, it is possible to have the ‘country postcode’ on the same line?
    So that the phone number on the next line doesn’t look weird even without the space.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Unfortunately, this is not possible in the free plugin, but you can do it using the Address customization section, included in the Professional extension to do it:

    A screenshot that displays the address customization area included in the Professional extension

    Thread Starter tjos123

    (@tjos123)

    Noted. Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Display country’ is closed to new replies.