diff --git a/portal/menu-builder.html b/portal/menu-builder.html
index 048592b..775fbd9 100644
--- a/portal/menu-builder.html
+++ b/portal/menu-builder.html
@@ -3504,8 +3504,13 @@
const data = await response.json();
if (data.OK) {
if (data.ACTION === 'created') {
- // New menu — redirect to wizard to populate it
- window.location.href = `${BASE_PATH}/portal/setup-wizard.html?businessId=${this.config.businessId}&menuId=${data.MENUID}&menuName=${encodeURIComponent(menuName)}`;
+ // New menu — store context and redirect to wizard to populate it
+ sessionStorage.setItem('payfrit_wizard_menu', JSON.stringify({
+ businessId: this.config.businessId,
+ menuId: data.MENUID,
+ menuName: menuName
+ }));
+ window.location.href = `${BASE_PATH}/portal/setup-wizard.html`;
return;
}
this.toast(`Menu ${data.ACTION}!`, 'success');
diff --git a/portal/setup-wizard.html b/portal/setup-wizard.html
index edb88e6..4ccc430 100644
--- a/portal/setup-wizard.html
+++ b/portal/setup-wizard.html
@@ -1054,14 +1054,19 @@
});
function initializeConfig() {
- // Parse URL parameters for add-menu mode
- const params = new URLSearchParams(window.location.search);
- const paramBusinessId = params.get('businessId');
- const paramMenuId = params.get('menuId');
-
- config.businessId = paramBusinessId ? parseInt(paramBusinessId) : null;
- config.menuId = paramMenuId ? parseInt(paramMenuId) : null;
- config.menuName = params.get('menuName') || null;
+ // Check for add-menu context from sessionStorage
+ const wizardMenu = sessionStorage.getItem('payfrit_wizard_menu');
+ if (wizardMenu) {
+ try {
+ const ctx = JSON.parse(wizardMenu);
+ config.businessId = ctx.businessId || null;
+ config.menuId = ctx.menuId || null;
+ config.menuName = ctx.menuName || null;
+ sessionStorage.removeItem('payfrit_wizard_menu');
+ } catch (e) {
+ sessionStorage.removeItem('payfrit_wizard_menu');
+ }
+ }
// Determine API base URL
const basePath = window.location.pathname.includes('/biz.payfrit.com/')