Files
IQ-Dynamic-Google-Pricing/includes
Malin 6209229e06 Fix Google product matching - GTIN is array in attributes
Based on actual API response analysis:
- offerId is at top level (e.g., "220216" = WooCommerce product ID)
- gtin is nested in attributes.gtin as an ARRAY (e.g., ["850018802833"])
- price is nested in attributes.price.amountMicros

Changes:
- Index Google products by each GTIN in the attributes.gtin array
- Also check attributes.gtins (alternative field name)
- Index by MPN if available
- Update find_product_by_identifier to check array GTINs with in_array()
- Fix price extraction to check attributes.price first, then top-level

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 17:50:30 +01:00
..