Magento Forum

Export Module for Google Base
 
teknology
Member
 
Avatar
Total Posts:  43
Joined:  2008-12-28
 

Check this out. For some reason all the products are displaying as having a price of 0.00

<item>    <title>02-06 Ducati 749 999 Adjustable Rearsets with Fixed Foot Pegs</title>    <link>http://shopvenomcycles.com/02-06-ducati-749-999-adjustable-rearsets-with-fixed-foot-pegs.html</link>    <g:price>0</g:price>    <g:id>4701</g:id>    <g:image_link>http://shopvenomcycles.com/media/catalog/product/2/0/2002-2006-ducati-749-999_5.jpg</g:image_link>    <g:description></g:description>    <g:brand>Lightech</g:brand>    <category>Sport And Touring</category>    <category_full>/Root Catalog/Sport And Touring</category_full>    <category_link>http://shopvenomcycles.com//default-category</category_link>    <g:condition>New</g:condition>    <g:mpn>4701</g:mpn>    <g:google_product_category>Vehicles &amp; Parts > Automotive Parts</g:google_product_category>    <g:google_product_category>Vehicles &amp; Parts > Automotive Parts</g:google_product_category>    <g:product_type>Vehicles &amp; Parts > Automotive Parts</g:product_type>        <g:tax><g:country>US</g:country><g:region>NJ</g:region><g:rate>7.00</g:rate><g:tax_ship>y</g:tax_ship></g:tax>  </item>
 
Magento Community Magento Community
Magento Community
Magento Community
 
Zap Sweets
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2010-08-05
 

Hello,

Thank you to everyone who has contributed on this thread, this has solved our Google Base problem in no time at all.

 
Magento Community Magento Community
Magento Community
Magento Community
 
testuser12
Jr. Member
 
Total Posts:  13
Joined:  2010-06-23
 
teknology - 22 July 2011 08:07 PM

Check this out. For some reason all the products are displaying as having a price of 0.00

<item>    <title>02-06 Ducati 749 999 Adjustable Rearsets with Fixed Foot Pegs</title>    <link>http://shopvenomcycles.com/02-06-ducati-749-999-adjustable-rearsets-with-fixed-foot-pegs.html</link>    <g:price>0</g:price>    <g:id>4701</g:id>    <g:image_link>http://shopvenomcycles.com/media/catalog/product/2/0/2002-2006-ducati-749-999_5.jpg</g:image_link>    <g:description></g:description>    <g:brand>Lightech</g:brand>    <category>Sport And Touring</category>    <category_full>/Root Catalog/Sport And Touring</category_full>    <category_link>http://shopvenomcycles.com//default-category</category_link>    <g:condition>New</g:condition>    <g:mpn>4701</g:mpn>    <g:google_product_category>Vehicles &amp; Parts > Automotive Parts</g:google_product_category>    <g:google_product_category>Vehicles &amp; Parts > Automotive Parts</g:google_product_category>    <g:product_type>Vehicles &amp; Parts > Automotive Parts</g:product_type>        <g:tax><g:country>US</g:country><g:region>NJ</g:region><g:rate>7.00</g:rate><g:tax_ship>y</g:tax_ship></g:tax>  </item>

You need to update the currency to your default currency

//SET CURRENCY //
$storeCurrency = ‘GB’;

this line set it to your default currency.

also for other lines such as:

$product_d14[’type’]=’ <g:product_type>’

adjust the product_type to your own product types.

and adjust:

$product_d17[’tax’]=’ <g:tax><g:country>

adjust this to your country code and the tax rate you have on items.

remember these lines are found 3 times in the google.php file, fix that up to your own preferences and you have a perfect working script.

 
Magento Community Magento Community
Magento Community
Magento Community
 
testuser12
Jr. Member
 
Total Posts:  13
Joined:  2010-06-23
 
elfling - 20 July 2011 04:32 AM

Latest Edition

Allows to set currency
Allows to set storeID

this works nicely in 1.5.1.0

however i have some issues unsolved.

usa - shopping.com + shopzilla: does not work or gives any output with items. (how to fix this?)

other countries / googlebase: imports data however there is an error about rss and xml tags being wrong.

quote on the error “Although Items recommended attributes are missing can be properly processed, we encourage you to review the relevant features to be included if available.”

how to fix this? and fix the shopping.com and shopzilla issue

 
Magento Community Magento Community
Magento Community
Magento Community
 
elfling
Enthusiast
 
Avatar
Total Posts:  901
Joined:  2008-10-21
 

For those who would like to add this to the configurable products to get sizing or color

$_associatedProducts $product->getTypeInstance()->getUsedProducts(); 
        
            foreach (
$_associatedProducts as $child{
        
                    
            $colour 
$child->getResource()->getAttribute('color')->getFrontend()->getValue($child);
            
$size $child->getResource()->getAttribute('size')->getFrontend()->getValue($child);
            if (
$colour{
        
            $product_d23[
'colour']='    <g:color>'.$colour.'</g:color>';
               
$feed_line .= implode("\t"$product_d23)."\r\n";
        
            
}
            
            
if ($size{
        
            $product_d24[
'size']='    <g:size>'.$size.'</g:size>';
               
$feed_line .= implode("\t"$product_d24)."\r\n";
        
            
}
  
            }

The only problem I have with it, is not getting it to display the attribute if it doesn’t exist, as it wants to display message ‘No’

 
Magento Community Magento Community
Magento Community
Magento Community
 
dawhoo
Jr. Member
 
Avatar
Total Posts:  10
Joined:  2008-05-16
 
elfling - 29 July 2011 05:38 AM

For those who would like to add this to the configurable products to get sizing or color

$_associatedProducts $product->getTypeInstance()->getUsedProducts(); 
        
            foreach (
$_associatedProducts as $child{
        
                    
            $colour 
$child->getResource()->getAttribute('color')->getFrontend()->getValue($child);
            
$size $child->getResource()->getAttribute('size')->getFrontend()->getValue($child);
            if (
$colour{
        
            $product_d23[
'colour']='    <g:color>'.$colour.'</g:color>';
               
$feed_line .= implode("\t"$product_d23)."\r\n";
        
            
}
            
            
if ($size{
        
            $product_d24[
'size']='    <g:size>'.$size.'</g:size>';
               
$feed_line .= implode("\t"$product_d24)."\r\n";
        
            
}
  
            }

The only problem I have with it, is not getting it to display the attribute if it doesn’t exist, as it wants to display message ‘No’

While this does make some interesting progress, I don’t know how the feed will like the many sizes under one product. Also, out of stock sizes/colors will make it into the feed, which is OK, if there is a stock indicator.

As for the size / color “No” I think you can solve that with a conditional for the color and size?  I haven’t tested it, so be sure to test thoroughly before making it into a feed

if ($colour!='No'

if (
$size!='No')
 
Magento Community Magento Community
Magento Community
Magento Community
 
elfling
Enthusiast
 
Avatar
Total Posts:  901
Joined:  2008-10-21
 

nope, already tried stuff like that, infact after a few hours of trying, I give up.

 
Magento Community Magento Community
Magento Community
Magento Community
 
louboutin18
Jr. Member
 
Total Posts:  13
Joined:  2011-04-19
 

Good post.

 
Magento Community Magento Community
Magento Community
Magento Community
 
march109
Jr. Member
 
Total Posts:  11
Joined:  2010-10-29
 
elfling - 21 July 2011 11:50 AM

ok a quick run down.

Download google.php from my post above.

Create a directory on your server. (doesn’t matter what)
Create another directory inside the one you just created and call it export and set it to writeable.

Place google.php in your random directory

Run google.php in your browser by going to

http://www.[domain-name]/[randomdirectory]/google.php

An export will be created called googlebase.xml in the export folder.

Then you need to do the rest of the work in Google itself.
Set the Feed name as googlebase.xml and the url of where to get it from.

You will need to modify your file slightly for your needs, however I’ve mostly got it contained now.

I think I’m being thick!

I’ve followed all this and run google.php but no file is generated in fact the success response seems wrong too.

The Processing has been COMPLETED!

658 products were succesfully exported.

Export took seconds.

Feed verification link:

googlebase.xml

Log record:

The feed location link takes me to [mydomain]/export/googlebase.xml and not [mydomian]/[my random folder]/export/googlebase.xml

and there are no values for seconds, nor is a log written.  File permissions of [my random folder] and export/ are both 777 so it can’t be that.

Can you help?

 
Magento Community Magento Community
Magento Community
Magento Community
 
march109
Jr. Member
 
Total Posts:  11
Joined:  2010-10-29
 

Update

This is now happening again, on Magento ver. 1.5.0.1 It didn’t work so I made the change outlined below.

Now its not working again, I have made no other changes since it ran the first time, downloaded the XML and deleted it from the server, ran it again and again, and finally again, (with sufficient time in between to export the 215 products), but the export folder is now empty with no sign of the files that were there before being created..

This has be baffled, I’ve made no changes, was working now not.  Any reason it may have issues with ver 1.5.x,x ?

I saw the post regarding;

Mage::app()->setCurrentStore($storeID);

But it makes no difference, since that post relates to the script not running and I’m still getting the success page! (still with no values for seconds though).  Its an interesting proooblem, one that has me head scratching!

march109 - 02 August 2011 03:01 AM
elfling - 21 July 2011 11:50 AM
ok a quick run down.

Download google.php from my post above.

Create a directory on your server. (doesn’t matter what)
Create another directory inside the one you just created and call it export and set it to writeable.

Place google.php in your random directory

Run google.php in your browser by going to

http://www.[domain-name]/[randomdirectory]/google.php

An export will be created called googlebase.xml in the export folder.

Then you need to do the rest of the work in Google itself.
Set the Feed name as googlebase.xml and the url of where to get it from.

You will need to modify your file slightly for your needs, however I’ve mostly got it contained now.

I think I’m being thick!

I’ve followed all this and run google.php but no file is generated in fact the success response seems wrong too.

The Processing has been COMPLETED!

658 products were succesfully exported.

Export took seconds.

Feed verification link:

googlebase.xml

Log record:

The feed location link takes me to [mydomain]/export/googlebase.xml and not [mydomian]/[my random folder]/export/googlebase.xml

and there are no values for seconds, nor is a log written.  File permissions of [my random folder] and export/ are both 777 so it can’t be that.

Can you help?

No panic, think its working; changed;

$_feed_dir = ‘export/’;

to

$_feed_dir = ‘[my random directory]/export/’;

Seems to have exported something but seconds.txt and counter.txt are empty, but if the feed works this is unimportant.

Many thanks for the script, I have already started to modify it, always great to start with it working.

 
Magento Community Magento Community
Magento Community
Magento Community
 
pcplod
Jr. Member
 
Total Posts:  7
Joined:  2008-10-07
 

Hi, Can anyone help. I\’m trying to get the top level category name only of my products in the feed. Any suggestions how to get it to show. We have several categories and wish to send google the name of the product and top level category only, not breadcrumbs.

Thanks in advance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
testuser12
Jr. Member
 
Total Posts:  13
Joined:  2010-06-23
 

@elfling

do you happen to know what might be the cause of this google email i received?

Thank you for submitting your items through Google Merchant Center.
We’ve recently reviewed the products for XXXXX (Account number:
XXXXXXX), and we’ve found some problems with your items:

1. Unsupported currency
2. Unsupported language

Issues:

1. Unsupported currency

We noticed your prices are listed in an unsupported currency. Products
listed in currency and country combinations other than those supported
won’t appear in our search applications. Please visit
http://google.com/support/merchants/bin/answer.py?answer=160619 for a list
of the currency and country combinations we currently support. In
addition, all prices displayed on your product pages must default to the
currency of the target country of your feed.

2. Unsupported language

It appears that your items are in a language that is not supported for the
target country that your data feed is registered in. Please visit
http://www.google.com/support/merchants/bin/answer.py?answer=160637 for
details on the language, currency and country combinations that we
currently support. If your data feed is in one of our supported languages,
please submit the feed to the appropriate target country. Please note that
any other language is not currently supported by the Google Merchant
Center. As we’re working hard to make Google Product Search available in
additional languages, we encourage you to check back periodically for
updates on our internationalization efforts.

Any idea on how to get this fixed?

language i used is english and i set the currency to us dollars.

what am i doing wrong according to google? anybody else having this problem?

 
Magento Community Magento Community
Magento Community
Magento Community
 
hairmax
Jr. Member
 
Total Posts:  4
Joined:  2011-08-03
 

Hi,
I have a store in Euro with ‘normal’ and ‘special prices’ I tried to export and it works fine except for the price. There’s only “” in the price column.
Any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tacgear
Member
 
Total Posts:  52
Joined:  2009-06-14
 

Guys please help!

I can not get this script to run from a cron to save my life! I can run it from the browser with no problem. It creates my txt file, creates a log file, email it to me, the whole nine. but when I set up my crontab to run it one of two things happen.

When I have line 4 set to

require_once "/home/myaccount/public_html/app/Mage.php";

I get no output, no log, no email from the script or from my cron manager in cpanel.

When I have line 4 set to

require_once $_SERVER['DOCUMENT_ROOT'"/app/Mage.php";

I get an email from my cron manager with an error

Warning: require_once(../app/Mage.php): failed to open streamNo such file or directory in /home/myaccount/public_html/googlefeed.php on line 4

Fatal error
: require_once(): Failed opening required '../app/Mage.php' (include_path='.:/usr/lib/php:/usr/local/lib/php'in /home/myaccount/public_html/googlefeed.php on line 4

My cron tab command looks like this

/usr/local/bin/php -/home/myaccount/public_html/googlefeed.php

I am literally pulling my hair out. Does no -one else have issues running this script via cron job?

I have an additional question as well When I do get a successful run from the browser. The tab delineated file has an empty line below every entry. Basically I’m getting an extra return thrown in somewhere. Anyone else had this problem?

 
Magento Community Magento Community
Magento Community
Magento Community
 
brendanb
Mentor
 
Total Posts:  1093
Joined:  2008-07-16
London, United Kingdom
 

just a stab in the dark, but does the cron user have permissions to run this particular job?

brendan

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top