Pentru ca fiecare intrebare este demna de un raspuns

WooCommerce free Google Product Feed

This tutorial will teach you how to create a Google product feed (for Google merchant center) using the products you have on your WordPress WooComerce store platform . You will be able to add the products from your woocommerce store to Google merchant centre, and have full control over the category of products they will appear on.

This tutorial is for all the people that do not want to purchase the Google Product Feed Plugin , from the WooCommerce store (or think that 50$ is a bit to much).

I will split this article into 3 sections :

Store Product feed Case study

Implementation

Further support

1. Store Product feed Case study
I had to design for a German client (dealershop24.de) an online store. They specialize in LED lighting solutions, so their products have a lot of technical specifications. Being used to wordpress, I decided to try to go for a ecomerce plugin that had the latest seo bells and whistles (microdata/rich snippets) so I went for woocommerce.
After all was set and done with the store, I realized that for the German market, google.de pushes a lot of “shopping results” right into the result page. It’s the same with United States, Brazil, Canada, Italy, UK, Spain and a few more countries that for the sake of keeping this short I will not mention them here :). (my home country, Romania, is not one of them).

So what does this really mean ? Well it means that soon Google will show you results and prices from various “respected” stores or retailers, each time you search for a particular brand or product. Trying to always stay on the edge of SEO and Google’s crazy ideas (Google wave comes to mind) I decided to give Google Merchant a chance.
My first question was how do I get “my store” listed there. The solution was simple enough, you just have to open an account. Everything is free as long as you are not from United State. (they need to pay in order to get their products shown in the result, but I have a feeling that soon enough we will all need to)
After I got my account id I was presented with an option to add a “new data feed”. After selecting my target country the format (googlebase) and a random data feed filename, I was left with a lot more questions than answers, like :

What format does the Google merchant data feed needs to be ?

It can be txt or XML (rss2 or atom) but I found that XML (RSS2) was the easiest to set up with the woocommerce store platform.

What information does the product feed need to contain ?
You will find additional information here : http://support.google.com/merchants/bin/answer.py?hl=en&answer=188494&topic=2473824&ctx=topic#other but keep in mind this is for an English store only !
There are country specific variables like ‘in stock’ is ‘auf lager’ for a German store, so you might need to consult your own version of that help file.
Keep in mind that Google_product_category and product_type are super case sensitive and MUST be chosen from a predefined list compiled by Google !

It’s a long list but here it goes :
id [id] – An identifier of the item
title [title] – Title of the item
description [description] – Description of the item
Google product category [Google_product_category] – Google’s category of the item
product type [product_type] – Your category of the item
link [link] – URL directly linking to your item’s page on your website
image link [image_link] – URL of an image of the item
additional image link [additional_image_link] – Additional URLs of images of the item
condition [condition] – Condition or state of the item
availability [availability] – Availability status of the item
price [price] – Price of the item
sale price [sale_price] – Advertised sale price of the item
sale price effective date [sale_price_effective_date] – Date range during which the item is on sale
brand [brand] – Brand of the item
gtin [gtin] – Global Trade Item Number (GTIN) of the item
mpn [mpn] – Manufacturer Part Number (MPN) of the item

Most of the data can be extracted from the Woocomerce store platform. (considering that you entered the information in the store)

2. Implementation of the woocommerce product feed

It’s pretty simple and straight forward :

a. You need to create your product feed and add some rewrite rules. For that you will need to add this to your theme “functions.php” file :

description – it can be anythingcondition – you must use the proper variables for your specific country (example for English: new, usedavailability – you must use the proper variables for your own country (for English:in stock, out of stock)brand – the brand of the productproduct_type – Important ! use only the Google specified product categories that you can find here http://support.google.com/merchants/bin/answer.py?hl=en&answer=160081Google_product_category– Important ! same as above

c. Access your product feed by adding going to http://yourStore/feed/products/
d. Specify the link to your product feed in your Google merchant account and on your webmaster tools under submit sitemap.
e. You are all done. It may take up to 4 days for your products to appear (given there are no errors in the submission) in the Google products results.

3. Further support

I will offer free advice and reply to your questions related to this article.
If you are unable to implement this free tutorial on how to get your woocommerce products listed in Google products, or you find this time consuming, I will do it for your, for a nominal fee of 25$ (just think of all the things you could do with that money, get a domain name for two years, feed a family of 5 ants for a whole year, get a half-decent host for 1 month, so don’t be lazy, don’t give me the money, I’ll probably use them to buy 5 packs of cigarettes that will last me exactly 3 days… ) :P

For the time being I will only work on English/German product feeds. After you acquire my services I will contact you via email within 24 hours and either work remotely using a program of your choice or just set the files up for uploading and guide you step by step on how to submit the product feed.
I will issue a full refund :
– If my schedule is too full and I am unable to contact you within 48 hours.
– If for some strage reason I am unable to get the feed working
– If you are unpleased with the results
– If I don’t like you
– If you don’t like me :)
I have started working on a wordpress plugin that I will offer free of charge (donation ware) but I do not have an estimate on when it will be completed.
(I’m a SEO guy, and I chose SEO because I’m lazy so…)

PLEASE ALWAYS SKIP TO THE LATEST UPDATE

UPDATE 03.01.2013 thanks to Taye from Iphone 5 AdapterNOTE ! Some servers (hosts) might not return the proper answer when requesting a feed
example http://web-sniffer.net/?url=http://www.appleiphone5adapter.co.uk/feed/&uak=9&type=HEAD returns a 404. you need to ask your web-hosting company if it’s possible to return a proper header during such a request.

You can test if your server is affected by this issue by going to http://web-sniffer.net filling in your domain name and adding /feed at the end. if you get a Status: HTTP/1.1 404 Not Found , you will not be able to submit your feed to google merchant. It does not matter if you can access it in your browser (it will show up on chrome), you will not be able to submit the feed.

A simple solution would be to go to your domain.name/feed/products by using google chrome as a browser, right-click, view source, and save the content of the source to a file, rename that file to products.xml and upload it to your domain root.

You can then use the yourdomain.name/products.xml file to insert your products into google merchant or just chose Manual upload and select the file you just created.

Keep in mind that this is not a real solution, since when you either change the prices, or add a new product, you will need to repeat the procedure. The real solution is checking with the server administrator of hosting for support. (just tell them that you need the server to issue a proper response whenever someone requests a rss feed)

UPDATE 31.01.2013 Thanks to JaneThere might be some issues with maya woocmerce theme. Before giving up try testing with another theme. Use this as a reference. DO NOT DEPLOY the theme commercially as it is a premium theme. (the guy who designed it might come after you (in your sleep :P ) if he finds out.

UPDATE 11.02.2013 Thanks to John; If you experience issues with the maya theme (or other themes) related to the fact that the product feed is not accessible it can be one of two possible issues :
1. You can’t access the yourdomain.tld/feed/products/ in any browser (you get a 404)
FIX : you need to turn on permalinks in your wordpress install (under settings -> permalinks -> post name)

2. You can access the yourdomain.tld/feed/products/ in chrome but you can’t submit it to google merchant or access it in any other browser (you get a 404 response)
FIX : you need to post a “post” in wordpress, so that the rss feed system gets activated/generated. do that and your theme will issue the proper response (200) when your product feed is called upon by google merchant.

60 Comments

100% yes. It looks like you are using mearishop theme. the only issue we would have would be related to shipping. if you offer free shipping on all products then it’s super easy to set up. if you offer a weight based shipping then you would need to add the weight for those particular products in the backend for each product. if it’s size based shipping then it’s a little bit harder (not impossible thou) to implement.
I’ve set up a ‘somewhat’ customized file for your site here http://victorciobanu.com/appleadaptor.txt
If you still need my help (or would like me to implement it for you, let me know)
Cheers mate.

His advice was completely free as he had already done most of the work and was just stuck at some syntax issues. He seemed to be a nice and polite guy and i was more than happy to help him . All i asked of him was a facebook like… and i think i got it :D

Hi Victor, Great piece of code and exactly what I was looking for thank you. Only one question, do you have cleaner up version of the code? I’ve spent the last hour trying to clear up the syntax but i’m only up to line 34.

Hi Victor, thanks a lot for this code! We have some products in our shop that are entered without a price, just for listing purposes. We get error messages for those because the price is missing – is there a way to exclude them?

Hi Peter, In theory, google merchant will exclude those by default, so you should not worry about that issue. Since my solution uses the integrated wordpress rss feed system, I can’t think of any “out-of-the-box” quick solutions (other than enforcing a set of theme function rules for those particular posts(products))

I have followed the instructions and have added the code. As per you update, I have experienced 404 header status for adumbro.co.uk/feed/products and have contacted the hosting company who have told me that is a wordpress issue and not a server issue. After googling around I have found that many similar questions on WP forums, but no solutions. Could you please guide me in a right direction? I am not sure how to resolve this…

Privet,
Just checked your feed, I used google chome browser, and the feed showed up as it should. Then I tried it in firefox, and nothing happens (no page is displayed). At this time I only have two and a half “solutions” :

0. You try using another woocommercetheme (other than maya) just to check if that is the problem. Here is the download link to a test theme. Please do not deploy this theme commercially (on the final version of the site) as it is a paid template.

1. (using google chome browser) You either copy the source of the created feed by right clicking http://www.adumbro.co.uk/feed/products and selecting view source, to a new file called whaterver.xml and submit that file to google merchant

2. You try setting up your site on a different server (i can provide you with a free temporary account on one of my servers if you don’t have a backup host)
I have hosting servers in Germany, US, Romania and Nederlands with configurations ranging from linux/windows apache/nginx/lightspeed mysql/mariadb/postgreSQL and after i’ve done the proper server setup , i managed to get the proper response on all of them. In this way you will know for a fact if it’s time to change the host (they are to lazy to do the changes needed for your site) or it’s a template/wordpress issue.

Hello,
could you help me to implement this code to my website please?
I have added the first codes at the top of my theme “functions.php” file and then created “product-feed.php” in my theme’s folder (same folder as functions.php), inputted the second code and made the necessary changes.
However I get a blank page when i try to navigate to the feed. My website is inner-goddess.co.uk.
Thanks

Sorry, I was away this weekend, so i never got to help you/read your message. I’m happy that you managed to fix it by yourself :) (you might be new to wordpress but you are definitely not new to coding :P) Glad i could provide you with the building blocks to make your product feed run.
Cheers

Oau ! John, there’s no other way to put this, except, YOU ROCK !
I’ve spent the better part of a day, trying to debug maya theme, in order to figure out why i was getting a 404 when trying to access the feed. I never figured it out, so i either advised people to change the theme (this issue is maya particular) or to “dump” the content of the xml (you can access it in chrome) and use that file (the “dump”) for the merchant account product feed. It never ever crossed my mind, the fact that if you never “post” a post under maya the rss never gets “active” (thus sending a proper 200 response when called).
I will post an update, asap
Cheers, and thank you for the great feedback , this is why i wrote the post to begin with (so that people would start helping each other)

Warning: require_once(/home/mhd-01/…/htdocs/wp-content/themes/atahualpa/product-feed.php) [function.require-once]: failed to open stream: No such file or directory in /home/mhd-01/…/htdocs/wp-includes/template.php on line 405

Hi Alex,
I currently working on a plugin, I should be ready by the end of the day with it :)
You did something wrong… i can’t set you in the right direction at this time, but I’ll get back to you once the plugin is ready .

Great plugin, thanks! I seem to have it all working fine – apart from one thing – the shipping. I offer free shipping worldwide on every product so should be easy. But the feed doesn’t pick this 0.00 up anywhere so I am getting this error message:

“Shipping is missing. Please specify in the ‘shipping’ attribute or in your account settings with a default shipping method selected for each targeted country. Note: Allow 15 minutes for account settings to take effect before uploading a new feed. Learn more.
”

My products still seem to be submitted but it says all of them have an error as no shipping is defined. Any ideas? Thanks in advance for the help.

here’s what I would do, I would set up shipping in the merchant account to free shipping, or, i would set weight to my products (the weight is sent to google merchant) and then establish a set of rules in shipping. Here is an example – in merchant account under setting – tax and shipping – Merchant account shipping settings

Hi, I have clicked buy it now and purchased your services but the email on paypal keeps bouncing back. Please can you email me with the info you require to info@stokeontrentduck.co.uk
Many thanks, Dave OSullivan

I have one question though before I try to do this myself: Does this still work if your site has multiple brands & google product types/categories as it seems that in product-feed.php you are defining fixed values?

Awesome! Thanks. Say, is the feed exclusive to the Google Merchant Centre? We need the same functionality for a remarketing agency (LiquidAds), but WP’s RSS feed does not contain images or product IDs, as you know.