Create a custom button for changing customer's localised preferences

It's always a good practice to show a country selector in your theme so your customer can change their shipping country preferences.

One UX-friendly way is to create a button in the header or footer to open the ORBE popup again so the customer can change their country and language.

You can create your HTML element in your theme code and add an on-click function to open the popup again.

If you have ORBE enabled in your theme, you need to call this JavaScript function on-click of this element to open the popup:


Code example

For example, if you want to add a custom icon in the header. You should add these lines of code: 

<span class="header__icon your-classes" onclick="mdApp_openAndRefreshModal()">
     {% render 'your-svg-icon' %}

This would be the end result: 


TIP: Show the close button in your popup so the user can close it without changes