If you use the code from leviathan you will get
<g:identifier_exists><=!=[=C=D=A=T=A=[False]=]=></g:identifier_exists>
simply change identifier_exists to ean or gtin
and you will get
<g:gtin><=!=[=C=D=A=T=A=[False]=]=></g:gtin>
Change
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); }
to
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:gtin');
$identifier_exists->appendChild($dom->createCDATASection($this->google_base_xml_sanitizer('False')));
$item->appendChild($identifier_exists); }
And if you want to create a default Brand value as False:
Change
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);
}
to
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);
} else {$identifier_exists = $dom->createElement('g:brand');
$identifier_exists->appendChild($dom->createCDATASection($this->google_base_xml_sanitizer('False')));
$item->appendChild($identifier_exists); }
==========================
Before update my error was:
Insufficient product identifiers: Missing two out of three attributes [GTIN, brand, mpn]22 errors.
After update:
Invalid GTIN value 22 errors.
Please make sure the value is a valid UPC-A (GTIN-12), EAN/JAN (GTIN-13), or GTIN-14. Learn more
Examples:...
I am working on the new error. But thankfully half has been fixed.
Bookmarks