if anyone has made a numinix product field for brand, can you send it to me or post it here... Oh I forget: the Manufacturers (admin> catalog> Manufacturers) are used for brand... ignore this question.
if anyone has made a numinix product field for brand, can you send it to me or post it here... Oh I forget: the Manufacturers (admin> catalog> Manufacturers) are used for brand... ignore this question.
Last edited by vandiermen; 12 Sep 2014 at 09:43 PM.
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
toPHP 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); }
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
toCode: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); }
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.
Last edited by vandiermen; 12 Sep 2014 at 10:30 PM.
My code was incorrect,
incorrect: <g:gtin><=!=[=C=D=A=T=A=[False]=]=></g:gtin> This is giving a displayable value of False to GTIN
correct: <g:identifier_exists><=!=[=C=D=A=T=A=[False]=]=></g:identifier_exists>This is giving a the correct invisible value of False to GTIN and Brand
So follow leviathan original code.
Either way google does not accept it, and requires Brand or GTIN and/or MPN (2 of 3 I think. GTIN is optional if you have Brand I think)
Last edited by vandiermen; 12 Sep 2014 at 10:53 PM.
p.s.
Adding Brand alone fixed GTIN and MPN errors.
Because I do not know what the brand name is I used the Business name as default (I hope google don't disqualify me for this, but it is working for now)
I added default brand name by editing \..\classes\google_base.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); }
to
Most products have a brand name so you're better off adding it in the Zencart Admin Manufactures (this works and will fix your GTIN and Brand error).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('MY BRAND NAME HERE'))); $item->appendChild($identifier_exists); }
Last edited by vandiermen; 12 Sep 2014 at 11:22 PM.