Providing your visitors with an RSS feed subscription is an excellent way to keep them updated with the latest products added to your store. Shopify automatically generates these for blogs, but not for collections. Bummer!
We can easily create an RSS 2.0 feed ourselves though with a couple simple steps. It’s rumored that Shopify may eventually automatically generate feeds for you, but until then we’ll need to improvise. Let’s get started.
Create a Page
First thing we need is a blank page. Login into your Shopify admin and follow the steps below…
You’ve setup the page where the feed will be available, which will be located at http://domain.com/pages/rss. Now let’s make sure you have a collection with all your products.
All Products Collection
If you don’t already have a smart collection with all your products setup, we’ll need that…
You’ve just setup a collection that will always contain all product in your store that have a price greater than 0. Now let’s create the actual feed…
Generate the Feed
This step is a simple copy and paste. Open theme.liquid from the Look & Feel tab and add the following block of code before the FIRST CHARACTER of the file…
{% case page.handle %}{% when "rss" %}<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>{{ shop.name }}</title>
<link>{{ shop.url }}</link>
<description>TYPE A 25-30 WORD DESCRIPTION OF YOUR FEED!</description>
<language>en-us</language>
<copyright>Copyright {{ "now" | date: "%Y" }} {{ shop.name }}</copyright>
{% for product in collections.all.products %}<item>
<title>{{ product.title }}</title>
<link>{{ shop.url }}{{ product.url }}</link>
<description>{% for image in product.images limit: 1 %}<p>
<img src="{{ image | product_img_url: 'medium' }}"
alt="{{ product.title }}" /></p>{% endfor %}<p>
<a href="{{ shop.url }}{{ product.url }}">
{{ product.title }}</a></p><p><strong>
{{ product.price_min | money }}{% if product.price_varies %} -
{{ product.price_max | money }}{% endif %}</strong>
</p><p>{{ product.description | strip_html |
truncate: 300 }}</p></description>
</item>
{% endfor %}</channel>
</rss>{% else %}
Do NOT move the page content down before pasting the code in. Just paste it and leave the rest trailing your new code. Be sure to replace the capitalized section in the code above with YOUR feed description. Finally, go to the very end of theme.liquid and add the following closing tag immediately after the LAST CHARACTER…
{% endcase %}
Open your browser and type http://domain.com/pages/rss in the URL and you should see a fully functional RSS 2.0 feed! Here’s the sample Vogue feed. While you could be completely finished right now, I prefer to use Feed Burner to track statistics and enhance the feed with their tools.
Feed Burner
If you choose to use Feed Burner, simply sign up for an account and use http://domain.com/pages/rss as the URL they request. You will then be given the opportunity to create your new URL, which will look something like http://feeds.feedburner/your-feed. Once you have the URL assigned, place it as a hyperlink somewhere on your site.
If you’re using Feed Burner, paste the following link in any/all of your liquid templates…
<a href="http://feeds.feedburner.com/your-feed">Subscribe</a>
Alternatively, you could use the feed we created…
<a href="/pages/rss">Subscribe</a>
Complete
That’s it! Now you have a fully functional, stat tracking RSS 2.0 feed for all your products!