Skip to content

Instantly share code, notes, and snippets.

@rsanchez
Created November 2, 2011 20:04
Show Gist options
  • Save rsanchez/1334725 to your computer and use it in GitHub Desktop.
Save rsanchez/1334725 to your computer and use it in GitHub Desktop.
CartThrob XML for Google Product Search
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0"
xmlns:g="http://base.google.com/ns/1.0">
<channel>
<title>{site_name} Products</title>
<link>{site_url}</link>
<description>[insert store description here]</description>
{exp:channel:entries channel="products" rdf="off" dynamic_start="on" limit="1000" disable="member_data|trackbacks"}
<item>
<title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
<link>{title_permalink=products/detail}</link>
<description>{exp:xml_encode}{product_description}{/exp:xml_encode}</description>
<g:image_link>{product_images limit="1"}{site_url}{product_image}{/product_images}</g:image_link>
<g:price>{product_price}</g:price>
<g:condition>new</g:condition>
<g:id>{product_vw}</g:id>
<g:brand>{exp:xml_encode}{product_brand}{/exp:xml_encode}</g:brand>
<g:gtin>{product_upc}</g:gtin>
<g:product_type>{categories limit="1" parent_only="yes"}{exp:xml_encode}{category_name}{/exp:xml_encode}{/categories}</g:product_type>
</item>
{/exp:channel:entries}
</channel>
</rss>
@rsanchez
Copy link
Author

rsanchez commented Nov 2, 2011

Just a start--use your own custom fields and content to fill out. Set your template as XML type and submit it to google: http://www.google.com/intl/en/products/waystosubmit.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment