#102 bug: woocommerce integration

Отворено
отворено пре 4 месеци од fszontagh · 2 коментара
Szontágh Ferenc коментирира пре 4 месеци

I added our demo woocommerce shop on the webui.

  • we need to filter the customer to country. At shoprenter integration this is already implemented, we detect users country, auto select it,list related unused phone numbers etc... See issue #97 and related commits. We need this implementation at the woocommerce integration model too. Currenlty all phone number is visible all - in - one without country / city selection.
  • i selected a phone number, added api keys etc.. shop created, but on the /webshops page: 'Error: storeId is not defined' at the sync status (when shop created, the sync starts in the background)
I added our demo woocommerce shop on the webui. - we need to filter the customer to country. At shoprenter integration this is already implemented, we detect users country, auto select it,list related unused phone numbers etc... See issue #97 and related commits. We need this implementation at the woocommerce integration model too. Currenlty all phone number is visible all - in - one without country / city selection. - i selected a phone number, added api keys etc.. shop created, but on the /webshops page: 'Error: storeId is not defined' at the sync status (when shop created, the sync starts in the background)
claude коментирира пре 4 месеци
Коаутор

@fszontagh I'm starting work on this issue now!

I'll be addressing both bugs in the WooCommerce integration:

  1. Country/city phone number filtering - I'll implement the same phone number filtering by country that was implemented for ShopRenter in issue #97, so users see only relevant phone numbers based on their country selection.

  2. 'Error: storeId is not defined' on sync status - I'll investigate and fix the undefined storeId error that appears on the /webshops page when viewing sync status after creating a new shop.

Let me start by examining the ShopRenter implementation for reference and then look at the WooCommerce integration code to understand the current state.

@fszontagh I'm starting work on this issue now! I'll be addressing both bugs in the WooCommerce integration: 1. **Country/city phone number filtering** - I'll implement the same phone number filtering by country that was implemented for ShopRenter in issue #97, so users see only relevant phone numbers based on their country selection. 2. **'Error: storeId is not defined' on sync status** - I'll investigate and fix the undefined storeId error that appears on the /webshops page when viewing sync status after creating a new shop. Let me start by examining the ShopRenter implementation for reference and then look at the WooCommerce integration code to understand the current state.
claude коментирира пре 4 месеци
Коаутор

@fszontagh I've completed the fixes for both WooCommerce integration bugs. Here's a summary of what was done:

Fixes Applied

Bug 1: 'storeId is not defined' Error on Sync Status

Root Cause: In woocommerce-sync/index.ts line 939, there was a variable reference error - the code was referencing storeId (camelCase) but the actual variable was store_id (snake_case).

Fix: Changed the query parameter from storeId to store_id:

// Before
.eq('store_id', storeId)

// After  
.eq('store_id', store_id)

Bug 2: Missing Country/City Phone Number Filter

Root Cause: The WooCommerceConnect component was using a simple PhoneNumberSelector that showed all available phone numbers without any country or city filtering.

Fix: Replaced the PhoneNumberSelector with cascading selectors matching the ShopRenter implementation:

  • Country selector - Lists all countries with available phone numbers
  • City selector - Shows cities in the selected country with available numbers
  • Phone number selector - Shows only available numbers in the selected city
  • Auto-detection - Automatically detects user's country from browser settings (navigator.language, timezone)

Changes Made

  • supabase/functions/woocommerce-sync/index.ts - Fixed variable reference error
  • shopcall.ai-main/src/components/WooCommerceConnect.tsx - Added cascading phone number selection

Deployment

  • ✅ Edge Function woocommerce-sync deployed to Supabase
  • ✅ Changes committed and pushed to git (commit f044791)

The fixes are now live. Please test by:

  1. Creating a new WooCommerce store connection - you should now see country/city/phone cascading selectors
  2. Checking the sync status on /webshops after store creation - the 'storeId is not defined' error should be resolved
@fszontagh I've completed the fixes for both WooCommerce integration bugs. Here's a summary of what was done: ## Fixes Applied ### Bug 1: 'storeId is not defined' Error on Sync Status **Root Cause**: In `woocommerce-sync/index.ts` line 939, there was a variable reference error - the code was referencing `storeId` (camelCase) but the actual variable was `store_id` (snake_case). **Fix**: Changed the query parameter from `storeId` to `store_id`: ```typescript // Before .eq('store_id', storeId) // After .eq('store_id', store_id) ``` ### Bug 2: Missing Country/City Phone Number Filter **Root Cause**: The `WooCommerceConnect` component was using a simple `PhoneNumberSelector` that showed all available phone numbers without any country or city filtering. **Fix**: Replaced the `PhoneNumberSelector` with cascading selectors matching the ShopRenter implementation: - **Country selector** - Lists all countries with available phone numbers - **City selector** - Shows cities in the selected country with available numbers - **Phone number selector** - Shows only available numbers in the selected city - **Auto-detection** - Automatically detects user's country from browser settings (navigator.language, timezone) ## Changes Made - `supabase/functions/woocommerce-sync/index.ts` - Fixed variable reference error - `shopcall.ai-main/src/components/WooCommerceConnect.tsx` - Added cascading phone number selection ## Deployment - ✅ Edge Function `woocommerce-sync` deployed to Supabase - ✅ Changes committed and pushed to git (commit f044791) The fixes are now live. Please test by: 1. Creating a new WooCommerce store connection - you should now see country/city/phone cascading selectors 2. Checking the sync status on /webshops after store creation - the 'storeId is not defined' error should be resolved
Пријавите се да се прикључе у овом разговору.
Нема фазе
Нема одговорних
2 учесника
Учитавање...
Откажи
Сачувај
Још нема садржаја.