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>/settings/checkoutwindow.auth_dialogauth_dialog is added to the window object with the following methods:open() - Opens the login popup dialogclose() - Closes the login popup dialogwindow.customerAuthStateisAuthenticated - true when the user is logged in, false otherwiseisGuest - true when the user is a guest (not logged in), false otherwisecustomerAuthState values are updated automatically after a page reload. However, they do NOT update dynamically after a user logs in via the popup. Theme developers must manually update these values after a successful login.vitrin:auth:success Event💡 Tip: You can skip dynamic updates entirely and just use window.location.reload()if reloading the page is sufficient for your theme’s flow.
redirect_to query parameter - When opening the login popup, add the destination URL as a query parameter.vitrin:auth:success event.redirect_to parameter from the URL to keep the page clean and prevent unwanted redirects.vitrin:auth:success Eventwindow.zidCustomStyles object. The SDK will automatically apply these styles to the corresponding components, ensuring proper scoping and isolation.auth_dialogwindow.zidCustomStyles object to apply any style overrides specific to the login popup.window.customerAuthState.isAuthenticated before attempting to open the login popup.customerAuthState manually - Update it in your vitrin:auth:success listener if you handle UI updates without reload.window.location.reload() if needed - If your flow doesn’t require dynamic UI changes, simply reload the page.vitrin:auth:success event.redirect_to when closed without login.auth_dialog isn’t available.https://dashboard.zid.sa/en-sa/stores/<store_id>/settings/checkout)window.auth_dialog object with open() and close() methodsvitrin:auth:success event on successful loginredirect_to query parameterredirect_to if closed without login