Zid Docs
AppsThemes
Payments
AppsThemes
Payments
Help Center
Slack
  1. Features
  • Getting Started
    • Introduction
    • Theme Development
    • Vitrin Changelog
    • Creating and Managing Theme Presets
    • Legacy Theme Migration
      • Store Settings Mapping
      • Moving to Vitrin Using LLMs
      • Twig to Jinja
      • Breaking Changes
  • Key Concepts
    • Architecture
    • Templates
      • Overview
      • Overridable Templates
      • Legacy Templates
      • Template Replacements
      • Templates Library
        • home.jinja
        • product.jinja
        • cart.jinja
        • category.jinja
        • products.jinja
        • categories.jinja
        • page.jinja
        • blogs.jinja
        • blog.jinja
        • faqs.jinja
        • reviews.jinja
        • questions.jinja
        • shipping_payment.jinja
        • 404_not_found.jinja
    • Settings
      • Schema files
      • Input Settings
      • Media Settings
      • Form Controls Settings
      • Products Settings
      • Additional Settings
      • Conditional Visibility
      • Migrating twig settings schema
    • Localization
      • localization (jinja v. twig)
    • Theme Editor
      • Overview
  • Building with Vitrin
    • Jinja Basics
    • Vitrin's Jinja Extensions
  • Vitrin CLI
    • Introduction
    • CLI Commands
  • Tips & Tricks
    • Performance
  • JS Integration
    • Supporting both Vitrin and Legacy themes
    • Responses & Errors
    • Cart
    • Products
    • Categories
    • Store
    • Account
    • Blogs
    • Options
    • Events
  • Features
    • SDK Popups – Integration Guidelines
    • Custom Styles Guide
    • Gift Card as a Popup
    • Addresses as a Popup
    • Login as a Popup
    • Checkout as a Popup
    • Apple Pay Quick Checkout
    • Region & Language Popup
    • Dynamic Bundle Products
    • Progressive Discounts
    • Customer Wallet & Cashback
    • Add Preorder Support to Your Theme
  • Mobile Apps
    • Scripts
  • API's
    • Authentication
      • Logout
      • Login Status
      • SMS Login
      • Verify SMS Login
      • WhatsApp Login
      • Verify WhatsApp Login
      • Email Login
      • Verify Email Login
      • Register
      • Register Guest
    • Products
      • List Products
      • Search Products
      • Calculate Product Options Price
      • Notify Product Stock Availability
      • Fetch Bundle Offers
      • Fetch Bundle Offers for a Product
      • List My Product Reviews
      • List Product Reviews
      • Create Product Review
      • Update Product Review
      • Delete Product Review
      • List Product Questions
      • Create Product Question
      • Get Product by Slug
      • Get Selection Groups
    • Categories
      • List Categories
    • Checkout
      • Get Cart
      • Remove Cart
      • Duplicate Cart
      • Add Cart Item
      • Empty Cart
      • Update Cart Item
      • Remove Cart Item
      • Upload Cart Input Field
      • Add Gift Card
      • Remove Gift Card
      • Apply Coupon
      • Remove Coupon From Cart
      • Check Coupon Validity
      • Apply Loyalty Points
      • Remove Loyalty Points
      • Preview Rewarded Points
      • List Redemption Methods for Cart
      • Customer’s Loyalty Wallet
      • Customer’s Current Points Balance
    • Account
      • Get Profile
      • Delete Account
      • Update Customer Profile
      • Get Addresses
      • Create an Address
      • Get an Address by ID
      • Update an Existing Address
      • Delete Address
      • Get Orders
      • Get Shareable Wishlist Link
      • Get Wishlist
      • Add Products to Wishlist
      • Remove Product from Wishlist
      • Get Address Form Schema
      • Check Product Purchase Status
    • Storefront
      • Store Scripts
      • Pages
      • Blogs
    • Countries
      • Get Countries
      • Get Cities By Country
  1. Features

Region & Language Popup

The Region & Language popup allows customers to change the store language, country, and city within a modal dialog, without leaving the current page. This provides a smoother localization experience and ensures content, products, pricing, and delivery options are tailored to the selected region.

About#

The region popup settings can be managed in the Merchant Dashboard on the inventory page:
Path:
https://dashboard.zid.sa/en-sa/stores/<store_id>/catalog/inventories
By default, Display products in your store based on the customer location is disabled for all stores. When enabled:
The city selector becomes visible inside the popup.
If Require customer to select city manually is checked, the popup will be forced for all customers who haven't selected a city, otherwise a default city in the region that has a shipping option will be selected.

Theme Usage Examples#

To enable the Region & Language popup in your theme, include the template and script in your layout.jinja file:

layout.jinja#

{% include "vitrin:shared/region_settings_dialog.jinja" %}

<script>
  window.zidOpenRegionSettingDialog = () => {
    region_settings_dialog.open();
  }
</script>
Now, you can use region_settings_dialog anywhere in your theme.

Custom Styles Integration#

The popup supports the Zid Custom Styles system. You can override specific styles safely without affecting other dialogs.

How to Use Custom Styles#

The component key for the checkout popup is region_settings_dialog.

To understand the complete flow of the Custom Styles system — including structure, validation, and advanced usage — please refer to the Custom Styles Guide for Theme Developers.

Custom Region and language popup#

If you want to create your own UI instead of using region_settings_dialog.
Zid provides APIs to replicate the same functionality.
MethodParametersDescription
zid.store.region.countriesnoneReturns 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.languagesnoneReturns the store languages

countries API#

The countries API returns countries depending on the Display products in your store based on the customer location switch in the inventory page:
Path: https://dashboard.zid.sa/en-sa/stores/<store_id>/catalog/inventories
Switch OFF: Returns only a list of countries (no cities).
Response Example:
[
    {
        "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": "السعودية"
        }
    }
]
Switch ON: Returns countries with cities included. Default city selections are also provided.
Response Example:
{
    "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 API#

Use this API to change the store language, country, and city. country_code and language are required; city_id is optional.

languages API#

Provides a list of store languages.
Response Example:
[
    {
        "id": 1,
        "name": "English",
        "code": "en",
        "direction": "ltr"
    },
    {
        "id": 2,
        "name": "العربيّة",
        "code": "ar",
        "direction": "rtl"
    }
]

Best Practices#

Include the template in the layout.jinja.
Always use optional chaining when interacting with the API.

API Reference Summary#

MethodParametersDescription
window.region_settings_dialog.open()noneOpens popup
window.region_settings_dialog.close()noneCloses the popup
zid.store.region.countriesnoneReturns 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.languagesnoneReturns the store languages

Summary#

Enabled by including {% include "vitrin:shared/region_settings_dialog.jinja" %}
Exposes window.region_settings_dialog global object
Fully style-able through window.zidCustomStyles.region_settings_dialog
Optional chaining recommended
Modified at 2026-02-17 07:02:10
Previous
Apple Pay Quick Checkout
Next
Dynamic Bundle Products
Built with