diff --git a/portal/setup-wizard.html b/portal/setup-wizard.html
index 6a171bb..49bf0c6 100644
--- a/portal/setup-wizard.html
+++ b/portal/setup-wizard.html
@@ -1428,8 +1428,9 @@
const menuPages = discoverResult.menuPages || [];
const siteName = discoverResult.siteName || '';
- // Store business info from discovery (JSON-LD, meta tags, etc.)
+ // Store business info and platform URLs from discovery
config.discoveredBusinessInfo = discoverResult.businessInfo || {};
+ config.platformPages = discoverResult.platformPages || [];
if (menuPages.length > 1) {
// Multiple menus found — show confirmation step
@@ -1572,6 +1573,43 @@
.join('; ');
}
+ // Fetch images from ordering platform (stealth Playwright)
+ const platformUrl = (config.platformPages || [])[0] || '';
+ let platformImageMap = {};
+ if (platformUrl && allItems.length > 0) {
+ document.getElementById('conversation').innerHTML = '';
+ addMessage('ai', `
+
+
+
Grabbing food photos from ordering platform...
+
+ `);
+
+ try {
+ const imgResp = await fetch(`${config.apiBaseUrl}/setup/analyzeMenuUrl.php`, {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ mode: 'platform_images', url: platformUrl, items: allItems.map(i => i.name) })
+ });
+ const imgResult = await imgResp.json();
+ if (imgResult.OK && imgResult.imageMap) {
+ platformImageMap = imgResult.imageMap;
+ const matchCount = Object.keys(platformImageMap).length;
+ // Match images to items by name
+ let matched = 0;
+ allItems.forEach(item => {
+ if (platformImageMap[item.name]) {
+ item.imageUrl = platformImageMap[item.name];
+ matched++;
+ }
+ });
+ console.log(`Platform images: ${matchCount} found, ${matched} matched to items`);
+ }
+ } catch (err) {
+ console.error('Platform image fetch error:', err);
+ }
+ }
+
// Build final combined data
document.getElementById('conversation').innerHTML = '';
config.extractedData = {
@@ -1589,9 +1627,11 @@
const totalItems = allItems.length;
const totalCats = allCategories.length;
+ const imgCount = allItems.filter(i => i.imageUrl).length;
const schedSummary = allMenus.filter(m => m.schedule).map(m => `${m.name}: ${m.schedule}`).join(', ');
addMessage('ai', `
Done! Found ${totalItems} items across ${totalCats} categories in ${allMenus.length} menus.
+ ${imgCount ? `${imgCount} item images found
` : ''}
${schedSummary ? `${schedSummary}
` : ''}
`);