Categories
Code Shopp

Add a Store Catalog XML Sitemap to the Shopp Plugin

The Shopp default RSS/XML/Google Base solution was not enough.

RSS Feed, BABY!

I needed to have a Google Base feed that featured all the store products. For some reason, the recommended process wasn’t working for me. It was either showing only recent products, or it wasn’t working at all.  Here’s how I fixed it:

This code will show you the way to full indexing. Trust it. Feel it.

Add the following code before case "newproducts-rss": (near line 1295) in Shopp.php:

// This adds sitemap functionality for all products
case "catalog-rss":
	$CatalogProducts = new CatalogProducts(array('show' => 50000));
	header("Content-type: application/rss+xml; charset=utf-8");
	echo shopp_rss($CatalogProducts->rss());
	exit();
	break;

Once you add that, you will be able to see a RSS feed of your entire catalog by visiting yoursite.com/your-shop-location/index.php?shopp_lookup=catalog-rss

If the RSS feed is empty, try commenting out (add // before it) the following code near line 484 in /core/model/Category.php: $item = apply_filters('shopp_rss_item',$entry,$product);

Hope this helps!

By Zack Katz

Zack Katz is the founder of GravityKit and TrustedLogin. He lives in Leverett, Massachusetts with his wife Juniper.

5 replies on “Add a Store Catalog XML Sitemap to the Shopp Plugin”

Hi.
Thanks for the piece of code it works great. I’m just trying to turn this RSS feed into xml or txt  or anyother type that google merchant center will accept. So if anyone could mention something on that.

Comments are closed.