• Resolved ruen06

    (@ruen06)


    Hi, I notice that billing and shipping address displaying in the order will not show the country if the country is the same as store address.

    How to show it?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello,

    I understand you would like to show the country on your orders even if the order is from the same country as the store.

    There is an alternative solution explained in this article, please check.

    Note: This solution uses custom code, we recommend Code Snippets to add custom PHP code into your site without directly accessing the functions.php file. Here is an page that explains how to use the Code Snippets plugin.

    I hope this points you in the right direction.

    Thread Starter ruen06

    (@ruen06)

    Hi, this code will add extra line to show country after customer note, and redundant for those already having billing country chown.

    Any other way to just show the origin country as usual as other orders?

    Hi @ruen06

    By default, country display is off when the customer is in the same country as the store. To disable that behavior, you can use the code below:

    add_filter( 'woocommerce_formatted_address_force_country_display', '__return_true' );

    Thread Starter ruen06

    (@ruen06)

    @maykato Thanks for the help, but the code is not working.

    P/S: I am using Flatsome theme, but i don’t think this affects as the code from stack overflow works fine. Just not the solution I want.

    • This reply was modified 2 years, 8 months ago by ruen06.
    Plugin Support Paulo P – a11n

    (@paulostp)

    Hello,

    Thanks for the help, but the code is not working

    I’ve just tested it on my local site and could confirm it’s working as expected. But, maybe we aren’t talking about the same place.

    This code will force the country to show in the “Edit Order” page, like shown in the images below.

    Before:

    Link to image: https://snipboard.io/dy5XvL.jpg

    After:

    Link to image: https://snipboard.io/RF0O7s.jpg

    Is this not what you were trying to do? Please let us know.

    Thread Starter ruen06

    (@ruen06)

    Yes! This is what I want. But strange that the code doesn’t work in my child theme php file

    Hi @ruen06

    the code doesn’t work in my child theme php file

    You can add it via a plugin that allows custom functions to be added, such as the Code Snippets plugin. Here is a guide on how to use the Code Snippets plugin.

    It is confirmed that the code works on a basic theme such as Storefront. If it doesn’t work on your child-theme then you may want to reach out to your developer in this regard.

    Alternatively, for direct assistance with code/theme customizations, you can also consult with the WooCommerce Customizations Partners: https://woocommerce.com/customizations/

    Thread Starter ruen06

    (@ruen06)

    Thanks it is working now!

    Glad to hear it – thanks for letting us know!

    Please feel free to open a new topic if you have any other questions.

    Cheers

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Address displaying in the order’ is closed to new replies.