• Hi,

    on the general page in WooCommerce you can enter the countries in which to sell. Is it possible to change the order of those countries? I ask therefore because I want Germany and Austria on the first and second position, so the customer does not have to scroll very long to get to those countries. Right now I have for example Austria on the last position of 50 countries.

    Thanks a lot for your help in advance.

    Best regards

    Albert

Viewing 2 replies - 1 through 2 (of 2 total)
  • Anonymous User 13528887

    (@anonymized-13528887)

    Hi,

    This might help you. Drop this code snippet in your functions.php file

    
    add_filter( 'woocommerce_countries',  'hl_change_countries_order' );
    function hl_change_countries_order( $countries ) {
      unset($countries['AT']);
      unset($countries['DE']);
      $countries = ['DE' => 'Germany'] + ['AT' => 'Austria'] + $countries;
      
      return $countries;
    }
    
    Thread Starter albert0346

    (@albert0346)

    Thanks Harshal!

    I included your code into the functions.php file of the plugin Theme Customizations from Github. By using this plugin you are safe that updates don’t overwrite your changes.

    But after insertion the country sorting order did NOT change. Any ideas?

    Albert

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change order of countries in which to sell’ is closed to new replies.