Add debug logging and expand Google product matching

- 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>
This commit is contained in:
2026-01-23 17:45:35 +01:00
parent 7ab4505fc8
commit e2ea95f445
2 changed files with 59 additions and 3 deletions

View File

@@ -202,7 +202,6 @@ console.log('Informatiq Smart Pricing: Script loaded');
e.preventDefault();
console.log('=== COMPARE PRODUCTS CLICKED ===');
alert('Compare Products button clicked! Check console for details.');
var $button = $(this);
var $spinner = $button.next('.spinner');
@@ -244,6 +243,16 @@ console.log('Informatiq Smart Pricing: Script loaded');
success: function(response) {
console.log('AJAX success callback');
console.log('AJAX response:', response);
// Log debug info if available.
if (response.data && response.data.debug) {
console.log('=== DEBUG INFO ===');
console.log('Sample Google product:', response.data.debug.sample_google_product);
console.log('Sample indexed keys:', response.data.debug.sample_google_keys);
console.log('Total indexed entries:', response.data.debug.index_count);
console.log('==================');
}
$status.hide();
if (response.success) {