Shopzilla WordPress Plugin (version 1.2)

Update 09/08: The latest released version is 1.3, you can read the release notes and download the updated plugin here

This is another update to the Shopzilla WordPress Plugin I released back in February. You can use this plugin to monetize a WordPress blog by featuring embedded product comparison results inside each blog post or on a sidebar.

Before you setup the plugin on your blog, you first need to apply to Shopzilla Publisher Program which is a “pay per click” affiliate program meaning each click on the product results below results in an affiliate commission to the publisher (a blogger in this case). This is very similar to how Google Adsense works except Shopzilla program is designed specifically for shopping oriented websites.

What is included with this update?

This particular plugin update makes it possible for you to configure the maximum number of products for each product comparison results table individually. This can be done with another (third) argument that you supply to the “shopzilla_offers” tag inside your blog post. If you leave the argument at 0 then the global value from the plugin options will be used.

For example the line of code below will product the price comparison table you see at the end of this blog post.


In addition to this change, I added a configuration parameter for the domain to be used to talk to the API server. Shopzilla has changed this domain in the past and this parameter will allow you to change it on the fly for your blog in case Shopzilla does it again in the future.

How do I get it on my blog?

To upgrade - just download this archive and copy its content on top of your previous installation in the “plugins” folder. For new installations please refer to the Readme file that comes with this plugin.

For more information on how to become a Shopzilla publisher please go to the Shopzilla Publisher Program home page. To find why I wrote this plugin, please read my original blog post about it.

See also:

41 Responses to “Shopzilla WordPress Plugin (version 1.2)”

  1. 1 Christopher Calvi Jun 16th, 2008 at 11:40 am

    Great plugin, Yan!

  2. 2 Tinh Jun 18th, 2008 at 10:23 am

    Hi there, it is a great plugin but it does not work in my blog. I followed all guidelines but nothing happens, i got API AND PUT THE CODE IN MY INDEX.PHP AND SINGGLEPOST.PHP BUT NOTHING HAPPENS.

    dO I NEED TO CHANGE API server path?


  3. 3 Rich Owings Sep 26th, 2008 at 2:00 pm


    I get this error when I try to activate the plugin…
    Parse error: syntax error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home/digitas7/public_html/bestgpsdeals/wp-content/plugins/shopzilla/shopzilla.php on line 27

  4. 4 Rich Owings Sep 28th, 2008 at 5:28 am

    It looks like the plugin doesn’t work with WP 2.6 . Any intentions to update it?

  5. 5 Yan Sep 28th, 2008 at 11:43 am

    Make sure the PHP you use is version 5. Earlier versions will give you the error you quoted in your comment.

    This blog runs on Wordpress 2.6.2 and as you can see the Shopzilla plugin is doing just fine

  6. 6 Rich Owings Sep 28th, 2008 at 11:47 am

    Hey, thanks for getting back to me. PHP is v 5.2.6. WP is version 2.6.1. I hope we can resolve this because it would be a huge help for me.

  7. 7 Rich Owings Sep 29th, 2008 at 11:57 am

    I updated WP to 2.6.2, but still get the same error.

  8. 8 Yan Sep 29th, 2008 at 1:06 pm

    I still suspect PHP version older than 5. Create phpinfo.php file of the following content in your HTTP home folder:

    < ?php

    Open this URL in your browser: [Your Domain]/phpinfo.php and verify PHP version (it will be on the top of the page). More info here:

  9. 9 Rich Owings Sep 29th, 2008 at 1:18 pm

    You’re right. It shows PHP 4.4.9. I had assumed a later version, since on the left side of my CPanel page it shows 5.2.6. I’ll check with my host and see what the deal is.

  10. 10 Rich Owings Sep 29th, 2008 at 1:32 pm

    That did it! Thank you so much for your help. I hope to try out the plugin later today.

  11. 11 Yan Sep 29th, 2008 at 1:34 pm

    It seems you have both installed. Try renaming phpinfo.php to phpinfo.php5 or edit your .htaccess file to set the right handler for files with PHP extension

  12. 12 Howard Oct 11th, 2008 at 11:27 am


    I have a suggestion for your plug-in. Instead of using “productID-some product number” in the link, use “keyword-some keyword.” Replace “some keyword” with the string of the blog title and let Shopzilla search return the relevant product.

    This will make the plug-in automatic and save the time having to search for a particular product. Then, this would be the ultimate Shopzilla plug-in!

  13. 13 Yan Oct 11th, 2008 at 12:05 pm

    What you suggest would display not one but many products that satisfy the search criteria. Shopzilla already has a widget like that, and I am using it on one of my websites. Wrapping it around in a WP plugin is a different story. I will think about it. The problem I see is that Shopzilla search is not all that great to fetch products by blog post title. I would have to add some code to enable you to filter out non-essential keywords, otherwise the product results will not be relevant (if any)

  14. 14 Howard Oct 11th, 2008 at 12:49 pm

    I see your point. I have only tried a couple of searches with the title as the keyword. When you search for “Widget 1234 Review” it returns widget accessories, too. Maybe you could filter only the first item. I realize you would have to rewrite some code. I’m only vaguely familiar with PHP or I would try to play around with it. I did try some simple changes in the code, but it was returning RSS read errors.

    I have not seen the Shopzilla widget you are speaking of that does this; I used the “Top Search Results” on the publisher site, copied the code and replaced a simple keyword search term with a blog title.

    I was just trying to think of a way to automate this plug-in. Anything in this business that frees up time is a plus!

  15. 15 Hiro Oct 25th, 2008 at 1:24 am

    Hi Yan,

    Cool plugin just need some assistance.
    I added the following code to test out the plugin

    But I Get the following error message:
    Error reading RSS data.

    Any help is appreciated :)

  16. 16 Rich Owings Nov 17th, 2008 at 11:59 am

    Hi Yan,

    Hey, the plugin is working great for me! Thank you very much!

    I have a question about caching… If I install the wp-cache plugin, will it overide the Shopzilla cache settings?

  17. 17 Jack Jan 3rd, 2009 at 12:34 pm

    I installed the plugin but nothing appears. I was sent an API key from Shopzilla in the form “apiKey-XXX…XXX” but the plugin settings pannel doesn’t accept “special characters” as the minus sign. I removed “apiKey-” and it saved the code but nothing appears on the page. How can I figure out what happens?

  18. 18 Chris Guthrie Jan 15th, 2009 at 12:40 am

    Looks like the plugin does not work in Wordpress 2.7… any plans to update it?

  19. 19 Yan Jan 15th, 2009 at 9:44 am

    @Chris – sure, let me upgrade my blog first! ;-)

    @Rich – my guess is that if you have wp-cache installed it will override any of the plugin caching because all your visitors will see is a snapshot of an already pre-generated and saved HTML code, but I might be wrong since I am not very familiar with wp-cache

    @Jack – what WP version are you using?

  20. 20 Chris Guthrie Jan 15th, 2009 at 6:38 pm

    Hey Yan,

    Thanks! Funny thing – I actually tried version 1.1 and that one worked (I still don’t have an API to test but the plugin activated alright in the admin control panel).

    What do you think about pulling the product from the blog title though? I saw that mentioned earlier in the comments but you thought it might not display relevant enough results? (makes sense I suppose if that’s the case)

  21. 21 Yan Jan 17th, 2009 at 6:47 pm

    I have a website (link below) where I do exactly that – pulling product from the post title. I had to build a set of about a hundred rules with vocabulary to filter out commonly used terms and characters that lower relevancy on search results

    Click on the links on the front page. Posts will open in a AJAX window and some will have Shopzilla widget at the bottom.

    Shopzilla is actually doing a great job with their API, I would not be able to do the same thing with PriceGrabber or, but still as you can see the results are often not good enough.

  22. 22 Chris Guthrie Jan 19th, 2009 at 5:29 pm

    Yah, I think I’d just settle for an updated plugin version for Wordpress 2.7 :D

    1.1 still seems to be working on my blog for some reason though so that’s good.

  23. 23 Hiro Jan 31st, 2009 at 4:39 am

    Hi Yan,
    I’ve installed your plug in and followed instruction but I’m getting the following error message.
    “Error reading RSS data” What would cause this issue?


    Any help is appreciated Thanks!

  24. 24 Chris Guthrie Feb 18th, 2009 at 1:14 am

    Hey any news on the possible version 1.3 of the plugin :D?

  25. 25 Yan Feb 18th, 2009 at 2:13 am

    What exactly are you looking for in v1.3 Chris?

  26. 26 Chris Guthrie Feb 24th, 2009 at 12:23 am

    Hey Yan,

    I guess the main thing is just the functionality. I tried 1.2 in my Wordpress 2.7x installation and it didn’t work.

    So I’m using 1.1 although the formatting of the way the products displayed looks a little off.

    i.e. the image is nested up and the description down (instead of having these side by side in terms of their alignment).

    For the most part I love it the way it is though :)

  27. 27 Rich Owings Apr 20th, 2009 at 7:16 am

    Hi Yan,

    Are you planning an update for WP 2.7?

  28. 28 antfarm May 21st, 2009 at 2:52 pm

    Hi Yan,

    Thanks for such a great plugin! Is there a way to use the plugin in the template file (php) as opposed to when writing a post?

    Thanks again,


  29. 29 Yan May 21st, 2009 at 11:16 pm

    @Chris – I am sure you can fix the layout problem by editing the CSS file that comes with the plugin installation

    @Rich – I guess it is time for me to upgrade! ;-) I am still running 2.6.2

    @antfarm – No, you cannot use it in the template (w/o much messing with the code). The filters this plugin uses are activated in blog posts

  30. 30 antfarm May 24th, 2009 at 5:35 am

    Hi Yan,

    I think I figured it out.

    I’ve added:
    echo shopzilla_product_offers (”=SHOPZILLA-PRODUCT-ID”);

    This seems to work but I encountered a general issue with the plugin. Some products don’t show results when I use the plugin (both via the template function and using the plugin properly with the post tag) but the Shopzilla feed does give results.

    Example – Product ID 837790039 doesn’t give any results with the plugin but gives two results directly in the XML feed:

    Any thoughts?

    Thanks again,


  31. 31 Yan May 24th, 2009 at 5:26 pm

    The API response for product id 837790039 is missing product description. I would think this is the reason why ‘Fascinations AntWorks Sculpture’ is not in the widget (the plugin doesn’t know how to populate the description table field)

  32. 32 Yan Jun 19th, 2009 at 11:53 pm

    I updated my blog to Wordpress 2.8 and the plugin works just fine. The only thing I had to do is open up the ‘cache’ folder for writing by all users

    chmod 777 ~/public_html/wp-content/cache

    your command may slightly vary depending on the location of your cache folder

  33. 33 mp3 player Jul 11th, 2009 at 8:31 am

    Hey, the plugin is working great for me! Thank you very much!

  34. 34 eBay Finder Aug 21st, 2009 at 11:14 pm

    This was great! We added it to our blog the other day! Very Nice! Thanks again! Keep up the good work!

  35. 35 Scott Sep 1st, 2009 at 2:38 pm

    The part missing from my post is the tag I embed. Which is (hopefully):


  36. 36 black friday Nov 24th, 2009 at 2:16 pm

    One of the best tools online for Wordpress 2.8

    I had to chmod 777 ~/public_html/wp-content/cache

    and it worked fine..

  37. 37 sean Jul 27th, 2010 at 3:52 pm

    Does not work in Wordpress 3.0

  38. 38 Route53 Sep 28th, 2010 at 12:46 pm

    Can you do this for Pricegrabber and/or Nextag?

  39. 39 formula blogger Apr 13th, 2011 at 1:38 am

    thanks i will try this plugin, i hope this woking at wp latest version

  40. 40 hamanchi Aug 16th, 2012 at 4:24 pm

    i am intend to use this plugin but it is so confusing for me how to use.
    I know it must be uploaded in plugin section and input all API key and affiliate id to use this plugin.
    But thing is how i made dynamic search query to perform the search result plus what about the searching filter things.
    Kindly if you have some manuals to how to configure this plugin please let me know.

  1. 1 { s } » themes/plugins for 06-12-2008 Pingback on Jun 12th, 2008 at 8:45 pm

Leave a Reply