Post Pic

ZStore Helper WordPress Plugin For Zazzle Store Builder

Update: 08/11/2009
The plugin has now been updated to add the new products available on Zazzle such as binders & letterheads. Also a few bugs have been fixed.
So a few members of Zazzle.com asked me to make a plugin for WordPress to make it easier to install the Zazzle Store Builder into WordPress. Usually it is [...]

Update: 08/11/2009

The plugin has now been updated to add the new products available on Zazzle such as binders & letterheads. Also a few bugs have been fixed.

So a few members of Zazzle.com asked me to make a plugin for WordPress to make it easier to install the Zazzle Store Builder into WordPress. Usually it is quite easy, but for a novice coder placing it into WordPress can be a pain since it requires some special workarounds to be done. So to make it easy for people using Wordpress I’ve made a plugin. I have asked the permission of Zazzle to release it and have now gotten permission, the only requirement is that you have download the Zazzle Store Builder from their website as you have to be a member & accept their terms & conditions to use it.

[figure 1]

[figure 1]


How Do I Install It?

Right here we go, the instuctions are as follows:

  1. Download the plugin (can be found at the bottom of this post.)
  2. Download the Zazzle Store Builder from here.
  3. Unzip the contents of the plugin (zstore-helper.zip) to the wp-content/plugins folder in your WP installation.
  4. Go to wp-content/plugins/zstore-helper/zstore which should be empty. Open the Zazzle Store Builder zip file. Go into the folder you can see & drag out the includes & css folders into the zstore folder. See figure 1 for what your directory should look like.
  5. Make sure that you have fancy permalinks enabled. So your URLs don’t have ?p=34 in them, the plugin will not work without this due to Zazzle’s store bulder code.
  6. Now go into your WordPress admin. Head to the plugins section & turn on the Zstore Helper plugin. Next head to the Zstore Helper options page that will appear under Settings & set some global options. These are the options that will always be run, unless you over ride them (more on that later).
  7. Once you’ve set the global options all you need to do is make a page or post & put [zstore] into it. Publish & your store will appear. :)

Options

Here is a list of the options available on the options page & detailed instructions on what they do:

Contributor Handle
The Zazzle username associated with the store you wish to show products from.
Associate ID
An ID used for referrals. Found under the associates center, which can be found in the gallery tab of MyZazzle.
Product Line ID
Allows you to display a specific product line. Leave blank to show all products from a gallery. The product line ID can be found by clicking on a product line in a gallery. The URL will look something like http://www.zazzle.com/coatsofarms/products/cg-196595220567583981. The string or numbers on the end is the product line ID.
Product Type
Exactly what it says. Restrict which type of product is shown from the gallery.
Keywords
Also exactly what it says. Restrict products returned from the gallery by a keyword. Comma seperated. Eg. Cat, star, cow. You get the idea.
Grid Width
How wide, in pixels, should the complete product grid be. Although this is in pixels you do not need the px on the end, just the number.
Grid Cell Size
The size of each grid cell. Just pick a size from the list.
Grid Cell Spacing
The space, again in pixels, between each grid cell. As before although the value is in pixels only the number is needed & not px.
Grid Cell Background Color
The color used for each grid cells background color. In HEX but without the hash(#). Eg. FFFFFF is white. For a list of HEX colors try this link. You want the 6 char string under the column ‘Hex’.
Use Google Analytics
If you want to use Google Analytics then set this to true & then fill in Google Analytics Number with your UA number from your Google Analytics account. If you already have a Google Analytics plugin running on WordPress you probably won’t need this.
Google Analytics Number (ID)
If you set the last option to true then this is where you put your Google Analytics Number. It looks like this: UA-xxxxxxx-x. If you already have a Google Analytics plugin running on WordPress you probably won’t need this.
Show How Many Products
How many products do you want to show per page, or if you have pagination turned off, how many do you want to show in total. Default is 20. It is generally not a good idea to set this above 100 or 150 as it could crash older computers while trying to load all the images.
Starting Page
What page of results do you want to start on.
Show Pagination
Do you want to show a pagination. A pagination is the list of numbers that represent links to other pages if there are too many products to show on the first page.
Show Sorting
Do you want to show the sorting options. This allows visitors to sort by the Date Created or Popularity if set to true.
Default Sorting
What you want the products to be sorted by, Date Created or Popularity. Applies even if Show Sorting is set to false.
Show ‘By’ Line
Do you want to show the products ‘By’ line. This is the line that says ‘by zazzlestore’. In other words do you want to show which store created the product.
Show Product Title
Pretty obvious. Do you want to show the products’ title.
Show Product Price
Again obvious. Do you want to show the products’ price.
Enable Caching
Do you want to enable caching. This helps reduce server load for both you and Zazzle since it saves the images it uses so it doesn’t have to contact Zazzle everytime. Handy if you get a lot of visitors.
Cache Lifetime
How long before the cache is deleted & a new set of images is retrieved from Zazzle. This is in seconds. (3600 seconds = 1 hour)

Shortcode Over-rides

Here is a list, with examples, of the attributes used for over-rides. They are similar to HTML attributes so HTML users should feel right at home. Their uses match the options above so refer to the list above for any explanations.

contributorhandle
Example: [zstore contributorhandle="ZazzleStore"]
associateid
Example: [zstore associateid="THEASSOCIATEID"]
productlineid
Example: [zstore productlineid="THEPRODUCTLINEID"]
producttype
Example: [zstore producttype="cards"]. You may use the three digit code or the name of a product from this list.
keywords
Example: [zstore keywords="cats"]. A list of keywords if more than one is used they must be comma(,) seperated.
gridwidth
Example: [zstore gridwidth="400"]
gridcellsize
Example: [zstore gridcellsize="medium"]. This must match either tiny, small, medium, large or huge.
gridcellspacing
Example: [zstore gridcellspacing="5"]
gridcellbgcolor
Example: [zstore gridcellbgcolor="FFFFFF"]
useanalytics
Example: [zstore useanalytics="false"]. Options are true or false.
analyticsid
Example: [zstore analyticsid="UA-xxxxxxx-x"]
showhowmany
Example: [zstore showhowmany="20"]
startpage
Example: [zstore startpage="1"]
showpagination
Example: [zstore showpagination="true"]. Options are true or false.
showsorting
Example: [zstore showsorting="true"]. Options are true or false
defaultsort
Example: [zstore defaultsort="date_created"]. Options are date_created or popularity.
showproductdescription
Example: [zstore showproductdescription="true"]. Options are true or false.
showbyline
Example: [zstore showbyline="ZazzleStore"]. Options are true or false.
showproducttitle
Example: [zstore showproducttitle="true"]. Options are true or false.
showproductprice
Example: [zstore showproductprice="true"]. Options are true or false.
usecaching
Example: [zstore usecaching="false"]. Options are true or false
cachelifetime
Example: [zstore cachelifetime="3600"]. Length in seconds.

You can use any of these in combination like this: [zstore contributorhandle="ZazzleStore" producttype="Mugs" keywords="cats, dogs"].

Product Type List

This is the list of product types for use with the producttype Shortcode attribute. They are the same as those listed in the drop down box on the options page, this list is here just for reference. Also they are case-insensitive.

  • Bumper Stickers
  • Cards
  • Mousepads
  • Buttons
  • Keychains
  • Magnets
  • Hats
  • Bags
  • Ties
  • Photo Sculptures
  • Aprons
  • Photo Prints
  • Calendars
  • Keds Shoes
  • Mugs
  • Postage
  • Skateboards
  • Stickers
  • Posters
  • Embroidered Shirts
  • Embroidered Bags
  • Embroidered Hats
  • T-Shirts
  • Postcards
  • Profile Cards
  • Binder
  • Pet Apparel
  • Invitation
  • Letterhead
  • Stationery
  • Flyer
  • Rackcard

Where Can I Download This Marvelous Invention?


Right here. Just click here to download the zip. Then jump back up to the top and follow the instructions carefully.

What About WordPress MU?

Well after a little bit of adjustments it will work in WPMU. You can download that version here. This version is only a mu-plugin if you want to use it as a normal plugin in WPMU then download the version above & place it in your plugins folder.

I Wanna See It Working!

Well just click the next page button below. :)

120 Responses

  1. 20.02.10 13:01:27

    Hi,

    I’ve just tested the plugin on my local MU install (version 2.9.1.1) and it seems to work ok, that means it’s probably something related to your install.

    It looks like Wordpress doesn’t know to parse [zstore] shortcodes. My best guess is that the plugin isn’t activating. As global MU plugins are activated automatically, I can only assume it hasn’t installed properly.

    Some, possibly, stupid questions now. Have you extracted the contents of the zstore-helper-mu folder (inside the zip) to the wp-content folder, and then placed the Zazzle store builder files into the zstore folder.

    That’s about the only thing I can think is wrong. You can always install the normal version of the plugin in MU, but you will have to activate it on a blog by blog basis.

    Hope that helps. Let me know if you find anything else and I’ll see if I can help anymore. :)

    • 20.02.10 23:06:49

      Yeah, I locally placed the zstore includes and css folders inside the zstore mu helper plugin folder before uploading it to the mu-plugins folder. All the options show up but it doesnt recognize the shortcode. I also tried the regular plug in but i get the same thing. Also, neither wishads nor the zazzle store gallery by roman seem to work. I think I’m just going to test it on a virgin wpmu install on one of my other domains, and if it works then I’ll just nuke this one and start over, or perhaps even just go with vanilla wp.

    • 21.02.10 00:08:59

      Hmmm! That’s puzzling… It’d be nice to know what’s happening there just in case it’s a bug, but there isn’t much else I can think of to help narrow down the problem.

      Let me know if you manage to get it working or if you figure out the problem. Sorry I couldn’t be more help. :)

    • 21.02.10 06:04:32

      I nuked my WPMU install, and reinstalled it, in case there was a plugin interfering. I tried using the mu version of the plugin to no success.
      I went back, and re downloaded both versions of your plug in and the zstore builder, and i created a zip containing the regular wp helper and the zstore files, and uploaded it via dashboard to a virgin wordpress install on another domain, and it worked, so I went ahead and deleted the plugin from my mu-plugins folder and uploaded the regular version on that same zip i created, and it works, as you can see here http://wageslavegods.com/wsg-store/
      Thanks for building this!.

    • 21.02.10 12:36:31

      No problems. I wish I knew why the MU version didn’t work though. Guess it’s just one of those mysteries. :lol:

      Glad you got it working though & sorry that you had so many problems getting it to work first time.

  2. 23.02.10 18:05:10

    Love the plugin but I’m having an issue with the code repeating on my page you can see it here http://www.cac-tv.com/store/

    I don’t have a clue what it could be.

    • 24.02.10 00:50:43

      I’m not exactly sure what is happening there. My best guess (from looking through your source code) is that a piece of javascript has mistaken something for what it was looking for & repeated the Zazzle Store Builder content as part of the object it was building. You can see where it hasn’t closed properly in your source:

      <img style='display:none' id="post-7590-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.cac-tv.com/store/',title:'STORE',tweet:'
      <!-- Powered by Zazzle. For more information, please visit http://www.zazzle.com  // -->
      

      Also periodically in your source code there are description: which looks like a javascript object (JSON).

      My best guess is to look at that. I hope that helps you a little, let me know if I can help any more. ;)

    • 24.02.10 01:49:25

      Hey thanks so much! It was my Meebo plugin causing the issue, I’ve had that repeat thing happen with a few of my other plugins too, now I can try to use them again. And I really like the Meebo Plugin but it is what it is. Once again thanks very much for the quick reponse and the help!

    • 24.02.10 12:20:29

      No problem, glad to be of help, and sorry about your Meebo plugin not working.

    • 24.02.10 15:47:33

      Thanks, one more thing, I don’t have widgets enabled on my site but I would like to display my store items in my sidebar, correct me if I’m wrong but I don’t think the shortcodes will work in the php flies if not are there any php codes for the “Overrides”?

    • 24.02.10 16:03:15

      You can place shortcodes into your sidebar using the PHP function WordPress uses to parse shorcodes. Just do this:

      echo do_shortcode('[ zstore ]');
      

      Take the spaces out from between the square brackets. WordPress is just being a pain & won’t let me write them if I don’t add the spaces. :lol:

Leave a Response

Please enclose code in [lang] tags. For example [php] echo 'hello world'; [/php]

* Name, Email, Comment are Required

£53.06 / £1200

Help me buy an iMac so I can develop iPhone/iPod apps. If you would like to donate, or you want to learn more about why I started this fund click here.

We're Talking About...