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

Addresses as a Popup

Overview#

The address dialog feature allows users to add or edit their shipping addresses without leaving the current page. When enabled, it provides a modal dialog for address management, creating a smoother and more seamless user experience.

Enabling the Feature#

The address dialog feature is enabled by including the template in your theme. There are no dashboard settings required.

How to Enable#

To enable the address dialog in your theme, include the following template:
{% include "vitrin:account/address_dialog.jinja" %}
Best Practice: Include this template only on pages that contain the address section in the customer profile, such as the account address management page. Avoid including it globally in the main layout file, as it is not needed across all pages.

Global API Objects#

window.address_dialog#

When the address dialog template is included, a global object address_dialog is added to the window object with the following methods:

Methods#

open(data?) – Opens the address dialog.
Without data → Opens in "Add New Address" mode
With { addressId: number } → Opens in "Edit Address" mode with the specified address
close() – Closes the address dialog

Usage Examples#

Events#

vitrin:address:submitted Event#

This event is fired immediately after a successful address submission (add or edit) through the dialog. Theme developers can listen to this event to update the DOM, refresh the address list, or reload the page.
Event Detail Structure:
Event Usage Example:
💡 Tip: You can skip dynamic updates entirely and just use window.location.reload() if reloading the page is sufficient for your theme's flow.

Custom Styles Integration#

You can customize the look and feel of the Address Dialog using the Zid SDK Custom Styles system. This allows you to apply your own CSS overrides for specific components without affecting other areas of the store.

How to Use Custom Styles#

The component key for the Address Dialog is address_dialog. Use this key to apply scoped style overrides.

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.

Best Practices#

Include the template only in the address section pages, not globally.
Always use optional chaining (window?.address_dialog?.open).
Listen to vitrin:address:submitted event for updates.
Support both add and edit modes.
Prefer dynamic updates for better UX.

API Reference Summary#

MethodParametersDescription
window.address_dialog.open()noneOpens dialog in "Add New Address" mode
window.address_dialog.open(data){ addressId: number }Opens dialog in "Edit Address" mode
window.address_dialog.close()noneCloses the address dialog

Events#

Event NameDetail StructureDescription
vitrin:address:submitted{ addressId?: number, isEditMode: boolean }Fired after successful address submission

Summary#

Enabled by including {% include "vitrin:account/address_dialog.jinja" %}
Should be included only in customer profile pages that have the address section
No dashboard settings required
Provides global window.address_dialog object
Supports Add and Edit address modes
Fires vitrin:address:submitted event on success
Safe with optional chaining
Fully customizable via window.zidCustomStyles.address_dialog
Modified at 2026-02-17 07:02:10
Previous
Gift Card as a Popup
Next
Login as a Popup
Built with