Google Merchant Center prices are always tax-inclusive, so now
the local WooCommerce price is also displayed with tax included
using wc_get_price_including_tax() for a fair comparison.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>
- Log sample Google product structure to help debug matching
- Expand matching to check nested 'attributes' field (new API format)
- Extract offerId from productId field (channel:lang:country:id format)
- Extract offerId from name field (resource path format)
- Return debug info in AJAX response (sample keys, sample product)
- Log debug info in browser console
- Remove alert popup since button is now working
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add "Load Product Comparison" button in admin
- Display WooCommerce products with local price (sale/regular)
- Show Google Merchant Center price for each product
- Show match type (offerId vs gtin) and match status
- Helps debug product matching issues
- Limited to 50 in-stock products for performance
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace service account authentication with OAuth 2.0 user flow
- Add "Authorize with Google" button in admin settings
- Handle OAuth callback and token exchange
- Store refresh token for automatic access token renewal
- Add revoke authorization functionality
- Update admin UI to show authorization status
- Update price updater to use new OAuth credentials
- Add CSRF protection with state parameter
This change supports organizations that have disabled service account
key creation via iam.disableServiceAccountKeyCreation policy.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>