From 3c16b588e1ab18223e4d2f89add498d95079f0c9 Mon Sep 17 00:00:00 2001 From: Admin Date: Fri, 12 Jun 2026 15:41:50 +0700 Subject: [PATCH] feat(model): open model with param using id key on url --- assets/js/modals.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/assets/js/modals.js b/assets/js/modals.js index ebe8200..c0f8711 100644 --- a/assets/js/modals.js +++ b/assets/js/modals.js @@ -685,4 +685,18 @@ } window.openValuationModal(email); }; + + // ── Auto-open a modal from the URL (e.g. ?_open=wc-quote-modal) ── + (function openModalFromUrl() { + const target = new URLSearchParams(window.location.search).get("_open"); + if (!target) return; + + if (target === "store-modal-overlay") { + window.openStoreModal(); + return; + } + + const el = document.getElementById(target); + if (el && typeof el.open === "function") el.open(); + })(); })();