SPB Git

spb/fabri-ka

Public

Agrégateur de produits québécois — www.fabri-ka.com

[ka6] fix connecteur donjjewellery.com: refonte WordPress/Woo → Next.js headless (backend Medusa) — le site a abandonné WooCommerce (Store API /wp-json/wc/store/v1/products en 404 Next.js « __next_error__ », wp-content ne survit que pour les médias sur media.donjjewellery.com; backend Medusa confirmé sur admin.donjjewellery.com /health 200 mais Store API verrouillée par x-publishable-api-key jamais exposée au client, tout est rendu serveur RSC). Le site est VIVANT et vend (prix affichés, og:price:amount présent sur chaque page produit, vérifié $1,585 = regular_price 1585). Fix en 2 volets: (1) fiche stores.json migrée woocommerce → generic (__generic__) avec sitemap_roots sur les 3 sitemaps produits (/sitemap/engagement-rings 1096 URLs, /sitemap/mens-products 191, /sitemap/womens-products 207); (2) generic.py: nouvelle clé fiche OPT-IN product_url_prefixes (miroir de skip_url_prefixes, jamais globale) car les URLs produit (/engagement-rings/…, /womens/…, /mens/…, slugs -variant_<ULID>) ne matchent PAS PRODUCT_URL_RE — sans elle, 0 URL retenue. L'extraction standard (og:title + og:price:amount + og:image + meta description) suffit, aucun fallback RSC nécessaire. Sync réel 2026-10-19: donjjewellery.com ok / 800 produits (+669, cap max_products; médiane 434 = l'ancien compte Woo, le nouveau site expose ~1494 URLs variantes). Non-régression generic nominal: atelierora.ca ok / 15 (0 erreur). pm2 restart fabri-ka-sync fait, web local 200. Si re-broken: vérifier que la fiche est restée generic + sitemap_roots/product_url_prefixes, et grep product_url_prefixes fabrika/connectors/generic.py (gare aux reverts concurrents).

Simon-Pierre Boucher committed (Oct 19, 2026) parent c3d185b Browse files

2 changed files +21 −3

modified data/stores.json +12 −2
@@ -42295,8 +42295,18 @@
42295 42295 "id": "donjjewellery.com",
42296 42296 "name": "Donj Jewellery",
42297 42297 "url": "https://donjjewellery.com",
42298 − "platform": "woocommerce",
42299 − "catalog_endpoint": "/wp-json/wc/store/v1/products",
42298 + "platform": "generic",
42299 + "catalog_endpoint": "__generic__",
42300 + "sitemap_roots": [
42301 + "/sitemap/engagement-rings",
42302 + "/sitemap/mens-products",
42303 + "/sitemap/womens-products"
42304 + ],
42305 + "product_url_prefixes": [
42306 + "/engagement-rings/",
42307 + "/womens/",
42308 + "/mens/"
42309 + ],
42300 42310 "city": "",
42301 42311 "region": "Laval",
42302 42312 "postal_prefix": "H7V",
modified fabrika/connectors/generic.py +9 −1
@@ -203,6 +203,12 @@ class GenericConnector(BaseConnector):
203 203 extra = [u if u.startswith("http") else f"{self.base}{u}"
204 204 for u in (self.store.get("sitemap_roots") or [])]
205 205 roots = extra + roots
206 + # URLs produit sous des préfixes propres au site, invisibles pour
207 + # PRODUCT_URL_RE (ex. donjjewellery.com, refonte Woo → Medusa headless
208 + # 2026-10 : produits sous /engagement-rings/…, /womens/…, /mens/…).
209 + # Inclusion OPT-IN par fiche registre (product_url_prefixes), jamais
210 + # globale — miroir de skip_url_prefixes.
211 + incl = tuple(self.store.get("product_url_prefixes") or [])
206 212 queue, depth_left = list(roots), 3
207 213 fetched_roots = 0
208 214 while queue and fetched_roots < 60:
@@ -231,7 +237,9 @@ class GenericConnector(BaseConnector):
231 237 for l in locs:
232 238 if l.endswith(".xml"):
233 239 continue
234 − if PRODUCT_URL_RE.search(l) and not NON_PRODUCT_RE.search(l):
240 + if (PRODUCT_URL_RE.search(l)
241 + or (incl and urlparse(l).path.startswith(incl))) \
242 + and not NON_PRODUCT_RE.search(l):
235 243 out.append(l)
236 244 if len(out) >= self.max_products * 2:
237 245 break
238 246
Menu

Theme