
Originally Posted by
leviathan
If you are still looking for help here, I have a small code edit you can do to get this working. The code edit is simple (about 4 lines) and will insert the identifier_exists = false element into the XML output. It will ONLY insert this if you DO NOT have UPC/ISBN/EAN set for your products. You will have to have the "UPC/ISBN/EAN" configuration option set to true in the google merchant configuration area, and this does require numinix product fields being installed.
STEP 0: BACK UP your_catalog/includes/classes/google_base.php
Step 1: Open your_catalog/includes/classes/google_base.php
Step 2: Go to ~ line 409
Step 3: Replace the following:
PHP Code:
} elseif ($products->fields['products_ean'] != '') {$ean = $dom->createElement('g:ean');$ean->appendChild($dom->createCDATASection($this->google_base_xml_sanitizer($products->fields['products_ean'])));$item->appendChild($ean);} }
with
PHP Code:
} elseif ($products->fields['products_ean'] != '') {$ean = $dom->createElement('g:ean');$ean->appendChild($dom->createCDATASection($this->google_base_xml_sanitizer($products->fields['products_ean'])));$item->appendChild($ean);} else {$identifier_exists = $dom->createElement('g:identifier_exists');$identifier_exists->appendChild($dom->createCDATASection($this->google_base_xml_sanitizer('False')));$item->appendChild($identifier_exists);}}
Step4: Save the file.
You can verify that the feed is correct by viewing the xml source and searching for identifier_exists. Any product without UPC/ISBN/EAN should have this field set.
Enjoy!
Lev
Code has not impact on my output xml. There is no EAN field and there is no EAN:False
before http://www.solarcamper.com.au/domain..._en_before.xml
after http://www.solarcamper.com.au/domain...s_en_after.xml
===========================================
I want to use this to value False on EAN(GTIN) and brand, and see if that helps my failing submission (rather than using attributes controller to add all of them).
Brand:
PHP Code:
if ($products->fields['manufacturers_name'] != '') { $manufacturers_name = $dom->createElement('g:brand'); $manufacturers_name->appendChild($dom->createCDATASection($this->google_base_xml_sanitizer($products->fields['manufacturers_name']))); $item->appendChild($manufacturers_name);
// same as above ?
} else {$identifier_exists = $dom->createElement('g:identifier_exists');$identifier_exists->appendChild($dom->createCDATASection($this->google_base_xml_sanitizer('False')));$item->appendChild($identifier_exists); }
===========================================
My Error: Insufficient product identifiers: Missing two out of three attributes [GTIN, brand, mpn]22 errors.
Google requires GTIN, I am hoping they see EAN as the same.
My MPN's are not missing but incorrect.
Google says: if the required data does not currently exist then the item may be submitted with an identifier_exists and a value of FALSE
if the data exists but is not submitted then that is grounds for disapproval or suspension at any time; invalid or self-assigned data is not allowed.
So because Brand and EAN probably exist but are not entered I may still get errors using value False, so maybe I do need to enter them but first I would like to test the false value without needing to add it in attributes controller if possible.