Country list
The Country list card on Checkout & pages improves the country and state fields at checkout and in the cart’s shipping calculator.
Flags and a searchable list#
Flags and a searchable list adds a flag beside every country, in the field and in the list, with a search box and the templates’ colors.
Off by default: the flag images add about 66 KB to the checkout and cart pages (about 159 KB on high-resolution screens such as phones and Retina displays). They download once and are then cached.
With Smart Phone Field active, its flag images are used instead. The phone field already loads them on the checkout, so the flags add nothing to download.
Phone-friendly picker#
Phone-friendly picker (on by default) opens the country and state lists on phones as a sheet, like Smart Phone Field’s country picker:
- A title (the state sheet uses the field’s own label: Governorate, Emirate, State)
- A search box that finds names with or without accents
- The current choice first
- Flags, when flags are on
- Large rows that are easy to tap
Larger screens keep the dropdown.
Countries at the top#
Countries at the top pins countries to the top of the list. Type two-letter country codes in order, for example KW, SA, AE, QA (up to 8).
Empty uses Smart Phone Field’s preferred countries when it is active, else your store country.
With Smart Phone Field#
When Smart Phone Field is active, the country and state lists take its look and colors:
- The same flag size (32 by 24), rounded corners and soft edge.
- The flag on the same grey box, with the arrow beside it, pointing up while the list is open.
- The current and highlighted country in its primary color, and its search box and scrollbar styles.
This follows Smart Phone Field’s own color setting, in the field, the dropdown and the phone picker, in both directions.
For developers#
add_filter( 'nbwt_country_top', function () {
return array( 'SA', 'AE', 'KW' );
} );