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

    Quote Originally Posted by leviathan View Post
    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.

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

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

    Quote Originally Posted by vandiermen View Post
    Code has not impact on my output xml. There is no EAN field and there is no EAN:False
    I installed numinix product fields, and optional_fields\upc_isbn which has the EAN field. I can now add the EAN field directly to items but still no default false
    Last edited by vandiermen; 12 Sep 2014 at 09:37 PM.

  3. #3
    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.

  4. #4
    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.

  5. #5
    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.

  6. #6
    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.

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

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

    Quote Originally Posted by vandiermen View Post
    Code has not impact on my output xml. There is no EAN field and there is no EAN:False
    I fixed it, what I did wrong was not follow the simple instructions of leviathan.
    "You will have to have the "UPC/ISBN/EAN" configuration option set to true in the google merchant configuration area"
    Sorry for posting.

 

 

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