From 6e97309323fbe62bbc3ed81c7160ffae0d524e28 Mon Sep 17 00:00:00 2001 From: Marco Gallegos Date: Mon, 8 Sep 2025 19:01:09 -0600 Subject: [PATCH] fix: Fix product import display and add payment methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix category mapping from 'Vanity Lashes'/'PMU Services' to 'PestaƱas'/'Microblading' - Update global products array when loading from API - Add debug logging for categories and products count - Add new payment methods: Otros, Interno, GiftCard šŸ¤– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- app.js | 17 ++++++++++++----- index.html | 21 +++++++++++++++++++++ 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/app.js b/app.js index 5e28f3c..0e9b5f7 100644 --- a/app.js +++ b/app.js @@ -2315,6 +2315,10 @@ async function loadProductsByCategories() { const allProducts = await response.json(); + // Update global products array + products = allProducts; + console.log('Products loaded:', products.length); + // Group products by category const productsByCategory = {}; allProducts.forEach(product => { @@ -2325,9 +2329,12 @@ async function loadProductsByCategories() { productsByCategory[category].push(product); }); - // Populate each category - renderProductsInCategory('Vanity Lashes', productsByCategory['Vanity Lashes'] || []); - renderProductsInCategory('PMU Services', productsByCategory['PMU Services'] || []); + // Log categories found + console.log('Categories found:', Object.keys(productsByCategory)); + + // Populate each category - map to correct category names + renderProductsInCategory('PestaƱas', productsByCategory['PestaƱas'] || []); + renderProductsInCategory('Microblading', productsByCategory['Microblading'] || []); renderProductsInCategory('UƱas', productsByCategory['UƱas'] || []); } catch (error) { @@ -2338,10 +2345,10 @@ async function loadProductsByCategories() { function renderProductsInCategory(categoryName, products) { let containerId; switch(categoryName) { - case 'Vanity Lashes': + case 'PestaƱas': containerId = 'pestanas-products'; break; - case 'PMU Services': + case 'Microblading': containerId = 'microblading-products'; break; case 'UƱas': diff --git a/index.html b/index.html index 05f4706..3bcaab2 100644 --- a/index.html +++ b/index.html @@ -297,6 +297,27 @@ Transferencia + + +