The country selector widget can be displayed by using a shortcode, or by dragging and dropping it to any widget area, like any standard WordPress widget. You can find more details about the two methods below


How to display the widget using a shortcode

You can call the shortcode as in the example below:


[aelia_pbc_country_selector_widget title="Widget title (optional)" widget_type="dropdown"]

 

The shortcode accepts the following parameters:

  • title
    The widget title (optional)
  • widget_type
    The widget type. The Prices by Country plugin supports a dropdown. Further types can be added by implementing a filter in your theme for wc_aelia_pbc_customer_country_selector_widget_types hook. If this parameter is not specified, dropdown widget type will be rendered by default.


How to use the shortcode via PHP

If you would like to call the shortcode from your template code, you can use WordPress' do_shortcode() function, like in the following example:

 

// Display the widget with countries in a dropdown list
echo do_shortcode('[aelia_pbc_country_selector_widget title="My widget title" widget_type="dropdown"]');

 

For more information about using shortcodes vua PHP, please refer to WordPress Codex. Function Reference/do shortcode/.


How to display the widget using sidebars/widget areas

The country selector widget can be dragged and dropped like any standard WordPress widget. To do so, you can proceed as follows.

  1. Go to the Wordpress Admin Panel > Appearance > Widgets

  2. Expand the sidebar/widget area where you would like to position the widget.
  3. Drag and drop the country selector in the new widget area,
  4. Change the widget title as you wish.

  5. Now the selector will be displayed in the frontend, in the area you selected.


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