Created
August 15, 2018 15:34
-
-
Save cameroncowden/d1877c74acb352390720770406c266d6 to your computer and use it in GitHub Desktop.
Shopify Google Product Feed xml generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
Instructions: | |
- Create a blank page called 'Google Base Product Feed'and save it | |
- Open that page for editing and select 'page.google-feed' from the page template selector | |
- Add a brief site description to the meta-shop-description snippet | |
- The feed url should now be available at http://www.yoursite.com/pages/google-base-product-feed | |
- validate your field at http://validator.w3.org/feed/ | |
- when ready, submit your feed at http://base.google.com | |
Notes: | |
- If you have to include VAT, either put "(including VAT)" or "(excluding VAT)" in the price field of your products (in Shopify, not the feed) and make the appropriate tax setup in your Google Base Settings | |
- for more info see http://ecommerce.shopify.com/c/ecommerce-design/t/feedify-your-shop-for-free-using-page-templates-29008 | |
- for a quick tutorial see http://ecommerce.shopify.com/c/ecommerce-design/t/feedify-your-shop-for-free-using-page-templates-29008/#comment-29549 | |
- Google Product feed specifications: https://support.google.com/merchants/answer/188494?hl=en-GB | |
Credits: | |
- Michael Larkin: http://www.pixallent.com | |
- Caroline Schnapp: http://www.11heavens.com | |
- Jamie: http://www.charlestoncreative.com | |
Note: with terminal, you can: curl www.yourstore.com/pages/product-feed > product_feed.xml to generate the file. | |
{% endcomment %}{%- layout none -%}<?xml version="1.0" encoding="UTF-8" ?> | |
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0"> | |
<channel> | |
<title>{{shop.name | escape }} Products</title> | |
<description>Handmade HELM Boots are timeless, versatile, and stylish footwear for modern men and women. We offer superior quality at a friendly price.</description> | |
<link>{{shop.url}}</link> | |
{% paginate collections.all.products by 1000 %} | |
{% for product in collections.all.products %} | |
<!-- Item #{{ forloop.index }} --> | |
<item> | |
<title><![CDATA[{{ product.title | strip_html | strip_newlines | escape | replace: 'amp;', 'and' | replace: '&', 'and' | replace: "é", "e" | replace: "à ", "a" }}]]></title> | |
<g:brand>{{product.vendor | escape }}</g:brand> | |
<g:product_type>{{product.type | escape }}</g:product_type> | |
<g:id>{{product.id}}</g:id> | |
<g:condition>New</g:condition> | |
<description><![CDATA[{{ product.description | strip_html | strip_newlines | replace: 'amp;', 'and' | replace: '&', 'and' | replace: "..", ". " | replace: " ", " " | replace: "‘", "'" | replace: "’", "'" | replace: "‘", "'" | replace: "’", "'" | replace: "’", "'" | replace: "’", "'" | replace: "“", "'" | replace: "‘", "'" | replace: "´", "'" | replace: "“", """ | replace: "â€", """ | replace: "–", "-" | replace: "–", "-" | replace: "â€â€", "-" | replace: "–", "—" | replace: "—", "—" | replace: "%", "%" | replace: "©", "©" | replace: "®", "®" | replace: "â„¢", "™" | replace: "£", "£" | replace: "ï¿Â", "*" | replace: "•", "*" | replace: "â€Â", "'" | replace: "é", "e" | replace: "é", "e" | replace: "à ", "a" | replace: "ó", "o" | replace: "ê", "e" | replace: "Ø", "O" | replace: "™", "" | replace: "®", "" }}]]></description> | |
<g:image_link>{{product.featured_image | product_img_url: 'large'}}</g:image_link> | |
<link>{{shop.url}}{{product.url}}</link> | |
<g:price>{{product.price | money_without_currency}}</g:price> | |
<g:quantity>1</g:quantity> | |
<g:payment_accepted>Visa</g:payment_accepted> | |
<g:payment_accepted>MasterCard</g:payment_accepted> | |
<g:payment_accepted>AmericanExpress</g:payment_accepted> | |
<g:payment_accepted>Discover</g:payment_accepted> | |
<g:payment_notes>We also accept Paypal and Google Checkout</g:payment_notes> | |
</item> | |
{% endfor %} | |
{% endpaginate %} | |
</channel> | |
</rss> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you very much!!!!! I was looking for this exact thing for my store.