Country Order Customization
Country Order Customization in Orbe's Selector
Last updated
Country Order Customization in Orbe's Selector
Last updated
In Orbe, the country list within the selector is alphabetically ordered by default. However, it's possible to customize this order using CSS, allowing you to prioritize certain countries by placing them at the top of the list.
For example, in this country selector, you can see that the United States and the United Kingdom are at the top when you open the selector:
Here's a step-by-step guide on how to achieve this through Custom CSS:
Step 1: Modify the Display of the List
To start, we need to change the display setting of the country list to a grid layout. This allows us to reorder the countries:
Step 2: Set Default Order
Next, set a default order for all countries in the list. This ensures that any country not explicitly reordered will follow this default setting:
Step 3: Reorder Specific Countries
Now, you can select specific countries and assign them a different order. In this example, we're moving the United States (US) and the United Kingdom (GB) to the top of the list:
By adding these CSS classes, you can easily customize the order of countries within the Orbe selector.
Simply replace "GB" and "US" with the country codes of your preferred countries to tailor the list to your needs. This refers to the ISO two-letter code (alpha-2) of the country. You can find the global list of country ISO two-letter codes at https://countrycode.org/.
Here's the complete CSS snippet for repositioning the United States and the United Kingdom at the top of the list:
With this customization, you can enhance the user experience by highlighting the most relevant countries for your business.
You can also achieve this by using this JavaScript code and adding it to your theme code:
In Orbe's Market Selector Popup, you can customize the country order using CSS.
Unlike the Geolocation Popup, the parent container already uses a grid
display by default, so you only need to adjust the order of the individual items.
Set all items to a default order and prioritize the desired countries:
In this example:
France (FR
) appears first.
Spain (ES
) appears second.
All other countries are shown below.
Replace the country codes (ES
, FR
) with your preferred ISO alpha-2 codes as needed. You can find the global list of country ISO two-letter codes at https://countrycode.org/.