1. Altering the aspect of elements via CSS

To alter the look and feel of the Country Selector widget, simply modify your theme's CSS file and use the following selectors:

/* Matches the container that wraps around the whole widget */
.widget_wc_aelia_country_selector_widget {
}

/* Matches the widget's title */
.widget_wc_aelia_country_selector_widget.widget-title {
}

/* Matches the dropdown list with the available countries */
.widget_wc_aelia_country_selector_widget.countries {
}

/* Matches the button that triggers the selection of the country */
.widget_wc_aelia_country_selector_widget.change_country {
}

You can use the above to change size, font, colours and any attribute of the Country Selector, to adapt it to your needs.


2. Advanced customisation - Custom template


2.1 Replace the existing template

The country selector widget is rendered using template files that can be found in {your wordpress folder}/wp-content/plugins/aelia-tax-display-by-country/views folder. The following standard templates are available:

  • country-selector-widget-dropdown.php: displays "dropdown" style selector.

If you wish to alter the templates, simply copy them in your theme. They should be put in {your theme folder}/woocommerce-tax-display-by-countryand have the same name of the original files. The Tax Display by Country plugin will then load them automatically instead of the default ones.


2.2 Register a new custom template

You can register a new template with the following code snippet:

// With this custom code, the template file would be {your theme folder}/wc-aelia-tax-display-by-country/country-selector-widget-custom.php
// The file name (i.e. country-selector-widget-custom.php) comes from the 'template' argument
add_filter('wc_aelia_tdbc_country_selector_widget_types', function($widget_types) {
    $widget_types['custom_widget'] = array(
        'name' => __('Custom widget', 'your-text-domain'),
        'template' => 'country-selector-widget-custom',
        'title' => __('Some description', 'custom-text-domain'),
    );
    return $widget_types;
});

You save the new custom template as {your theme folder}/wc-aelia-tax-display-by-country/<template name>.php. You should then be able to see it in the options list for the country selector widget.



You can purchase the Tax Display by Country plugin from our online shop.