• Resolved petesh

    (@petesh)


    Hey… I am rather new to WordPress and woocommerce and my programming skills are limited to CSS and HTML. I managed to get the Invoice adapeted to my needs, the only problem I can’t solve for two days now is, that the invoice will not show the country of the buyer.

    I nailed the problem down to the “$order->get_formatted_billing_address()” function in the
    “print-content.php” file which does not return the country, despite the fact that is is set in the all the orders.

    The problem very likely lies outside of this plugin, as other plugins are also not showing the country. All I need is a piece of code that returns the country to paste at the right place in the php.

    The “get_billing_address( )” function seemed promissing as it returns comma seperated values (including the two letter country code) but I don’t know how to just get the country code alone and how to change the two letter code into the full country name.

    I hope someone out there can help me with this!
    Thanks a lot!

    Maybe usefull: http://docs.woothemes.com/wc-apidocs/class-WC_Order.html

    https://wordpress.org/plugins/woocommerce-delivery-notes/

Viewing 2 replies - 1 through 2 (of 2 total)
  • this depends on your localized woocommerce address format and has nothing to do with this plugin. by default woocommerce removes the country from the address if the shop base country is the same as the customers country. but you can switch that off with the woocommerce_formatted_address_force_country_display hook. an example:

    function my_address_with_country( $country ) {
    	return true;
    }
    add_filter( 'woocommerce_formatted_address_force_country_display', 'my_address_with_country' );

    you can look at the class-wc-countries.php for more info.

    Thread Starter petesh

    (@petesh)

    ohhh, get it! thanks a lot for helping out!

    (the problem is that we send things from another country than where we are based)

    thanks a lot again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Country Missing on Invoice’ is closed to new replies.