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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user