Results 1 to 10 of 505

Hybrid View

  1. #1
    Join Date
    Feb 2007
    Posts
    513
    Plugin Contributions
    2

    Default Re: Google Merchant Center Feeder for ZC v1.5.x

    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.

  2. #2
    Join Date
    Feb 2007
    Posts
    513
    Plugin Contributions
    2

    Default Re: Google Merchant Center Feeder for ZC v1.5.x

    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.
    Last edited by vandiermen; 12 Sep 2014 at 10:30 PM.

  3. #3
    Join Date
    Feb 2007
    Posts
    513
    Plugin Contributions
    2

    Default Re: Google Merchant Center Feeder for ZC v1.5.x

    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.

  4. #4
    Join Date
    Feb 2007
    Posts
    513
    Plugin Contributions
    2

    Default Re: Google Merchant Center Feeder for ZC v1.5.x

    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

    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);        }
    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).
    Last edited by vandiermen; 12 Sep 2014 at 11:22 PM.

 

 

Similar Threads

  1. v151 Google merchant Centre Feeder query
    By Phil Lomas in forum General Questions
    Replies: 13
    Last Post: 24 Dec 2013, 03:37 AM
  2. Google Base Feeder Support Thread [OLD]
    By numinix in forum All Other Contributions/Addons
    Replies: 3562
    Last Post: 2 Apr 2012, 06:30 PM
  3. Removing products from Google Merchant Feeder
    By wonderbread101 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 24 Dec 2011, 05:31 PM
  4. Google Merchant Center for Dummies?
    By xcergy in forum General Questions
    Replies: 7
    Last Post: 31 Mar 2010, 06:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg