Themes built on the Twig templating engine are now deprecated and require migration to Vitrin to ensure continued support and compatibility with Zid.
https://dashboard.zid.sa/en-sa/stores/<store_id>/catalog/inventorieslayout.jinja file:layout.jinja{% include "vitrin:shared/region_settings_dialog.jinja" %}
<script>
window.zidOpenRegionSettingDialog = () => {
region_settings_dialog.open();
}
</script>region_settings_dialog anywhere in your theme.region_settings_dialog.region_settings_dialog.| Method | Parameters | Description |
|---|---|---|
zid.store.region.countries | none | Returns the list of store countries store countries |
zid.store.region.setRegion | { language, city_id, country_code } | Changes the store language, country, and city |
zid.store.region.languages | none | Returns the store languages |
countries APIcountries API returns countries depending on the Display products in your store based on the customer location switch in the inventory page:https://dashboard.zid.sa/en-sa/stores/<store_id>/catalog/inventories[
{
"id": 184,
"name": "Saudi Arabia",
"code": "SA",
"country_code": "+966",
"flag": "https://zid-testing-907587157081.s3.eu-west-1.amazonaws.com/static/sa.svg",
"currency_code": "SAR",
"iso_code_2": "SA",
"iso_code_3": "SAU",
"address_format": "",
"postcode_required": 0,
"names": {
"en": "Saudi Arabia",
"ar": "السعودية"
}
}
]{
"countries": [
{
"id": 184,
"name": "السعودية",
"code": "SA",
"country_code": null,
"flag_icon": "https://zid-testing-907587157081.s3.eu-west-1.amazonaws.com/static/sa.svg",
"cities": [
{
"id": 1,
"name": "الرياض",
"country_code": "SA"
},
{
"id": 71,
"name": "جدة",
"country_code": "SA"
},
{
"id": 76,
"name": "مكة المكرمة",
"country_code": "SA"
},
{
"id": 24,
"name": "الدمام",
"country_code": "SA"
}
],
"flags": {
"is_sms_enabled": true
}
}
],
"default_cities": {
"SA": {
"id": 1,
"name": "الرياض",
"country_code": "SA"
},
"AE": {
"id": 125,
"name": "أبوظبي",
"country_code": "AE"
},
"OM": {
"id": 193,
"name": "مسقط",
"country_code": "OM"
},
"BH": {
"id": 141,
"name": "المنامة",
"country_code": "BH"
}
}
}setRegion APIcountry_code and language are required; city_id is optional.languages API[
{
"id": 1,
"name": "English",
"code": "en",
"direction": "ltr"
},
{
"id": 2,
"name": "العربيّة",
"code": "ar",
"direction": "rtl"
}
]layout.jinja.| Method | Parameters | Description |
|---|---|---|
window.region_settings_dialog.open() | none | Opens popup |
window.region_settings_dialog.close() | none | Closes the popup |
zid.store.region.countries | none | Returns the list of store countries store countries |
zid.store.region.setRegion | { language, city_id, country_code } | Changes the store language, country, and city |
zid.store.region.languages | none | Returns the store languages |
{% include "vitrin:shared/region_settings_dialog.jinja" %}window.region_settings_dialog global objectwindow.zidCustomStyles.region_settings_dialog