How to Make Zazzle Store Builder Links Open in a New Browser Tab

/ Zazzle / by Lisa Marie Robinson / 13 Comments
This post was published back on January 3, 2010 and may be outdated. Please use caution when following older tutorials or using older code. After reading be sure to check for newer procedures or updates to code.

Unlike similar applications which are offered by other POD websites, the Zazzle Store Builder doesn’t allow us to view the actual product pages from within our personal website. Why? The Store Builder only accesses Zazzle’s feed to pull back products… Nothing more, nothing less!

Store Builder pulls in the products, a potential customer clicks a link to view your product in more detail and they get whisked off to Zazzle for a better look. Good… That’s what we want, potential sales… Except, here’s the catch.

By default, the Store Builder tells all of it’s product links to load it’s target page in the current tab of your browser window… bye bye personal website! So, how do we get it to load pages in a new browser tab? Well, it’s fairly simple to do, only takes a few minutes, and can be used whether you have the Store Builder installed on a self built website or one which uses a CMS.

IMPORTANT: The following tutorial involves editing one of Store Builder’s core files. PLEASE make a back-up copy, as instructed in step 1, before you make any changes to it.

Step One:

First you will need to open zstore.php in your preferred code editing program (Dreamweaver, Notepad++, etc). You’ll find it inside the zstore/includes folder. Before you start make a back-up copy of this file by using save as. Don’t rename the file, just save it with the same name to another folder somewhere on your computer. If something goes wrong, you can use this file to overwrite the one you’re going to edit in step two. Hopefully you won’t need it!

Step Two:

Okay, now you’ve done that you’ll need to locate the section of code that needs a few alteterations to it. It starts on line 471 and ends on line 490, if you’re using Dreamweaver, and it looks like this:

It might look daunting at first but don’t worry. In this piece of code are the 5 lines which generate the links to your products on Zazzle. These links are the product title link, the product description link, the show by line link, the product price link, and the product thumbnail link. All we are going to do is add a new attribute to each of the <a> tags to make these links open in a new tab, or window if your browser is set up that way.

Step Three: The product title link

Okay, first on the list is the product title link. This is located on line 472 and looks like this:

All you need to do is add the attribute target=\"_blank\" to the end of the opening <a> tag. Those of you familar with HTML will notice it looks a little different than it usually does. The addition of the \ before the quotes changes the meaning of them so that we can use them within PHP. Quotes are part of the PHP coding language and mean something completely different to what they do in HTML. If we don’t change the meaning of them by using \, PHP will throw it’s toys out of the pram!

Anyway, the line of code should now look like this:

Step Four: The product description link

Next locate the product description link on line 477. It looks like this:

Do exactly the same thing as you did for the product title link and add target=\"_blank\" to the <a> tag. Your code should now look like this:

Step Five: The byline (artist) link

Next locate the byline link which will now be on line 481. It looks like this:

Add target=\"_blank\" to the <a> tag and it should now look like this:

Step Six: The product price link

Next locate the product price link which will now be on line 484. It looks like this:

Add target=\"_blank\" to the <a> tag and it should now look like this:

Step Seven: The product thumbnail link

Finally you need to work your magic on the product thumbnail link. The line of code you need should be on line 491 and looks like this:

This time you need to use the normal HTML version of target="_blank". No \ needed. However, make sure you put it in the <a> and not the <img /> tag. It should now look like this:

All done!

That’s it. Upload the edited version of zstore.php to the zstore/includes folder, try your Store Builder links, and hopefully they’ll open in a new tab or window. Sit back. Relax. Job done!

13 Comments

Author’s gravatar

Thanks this is great. It didn’t work at first, but then I realized you have a small error in the instructions in your first line of suggested code. In the first section you have written target="\_blank\" but the quotation marks are on the wrong side of the \ in that example (which I had cut and paste). It should be target=\"_blank\" which is what you have in all the other sections. Dreamweaver helped because it showed the incorrect code in a different color from the rest of the PHP string. Anyway, as you so nicely put it, when I tried it the first way, PHP “threw the toys out of the pram!” My page disappeared.

Reply
Author’s gravatar author

Thanks for spotting the error. 🙂 It’s hard to believe I proof read it 5 times! Glad everything worked out fine for you. 🙂

Author’s gravatar

Lisa, thank you so much for your help! I have been trying to find help with this forever. I can’t wait to go home and start trying this out!

God Bless!

Tamika

Reply
Author’s gravatar author

Your very welcome. Always glad to help a fellow Zazzler! 🙂

Author’s gravatar

Good info, thanks. I actually started with the zstore builder and eventually replaced it with all new code, as you can see on citylimitsgear.com.

Reply
Author’s gravatar

Thank you for this tutorial. I am hoping you can help me figure out what I am doing wrong or maybe there is a newer solution to the above?

Before coming to this tutorial I had already got the byline and product price links opening in new windows. The other 3 links however I could not get to do the same. I followed the above to a T and copy and pasted the code to avoid errors and still the only two that open in a new window are as stated above.

This is my client’s site I am creating and the shop is here: lifeonthestoop.com/shop/clothing-other-gifts/

Any help would be greatly appreciated! Also if there is no fix for the open in new window, is there a way to make those 3 links inactive where they only pull data, but are not clickable?

Thank you for your creating the plugin and your help.

Jamie Pelaez
skype: jamie.pelaez

Reply
Author’s gravatar

Hi Jamie,

I’m sorry I haven’t replied. Had a mahoosive computer failure and only just managed to get everything working again.

Looking at your source code I can see that you have added the targeting. The only thing I can think of that would cause the problem is the tracking code. It uses return false in the hyperlink to cancel the browsers default action, that could also be canceling the target blank.

Other than that I can’t see any reason for it not to be working. You could try disabling any tracking code (it looks like Google Analytics) temporarily to see if it fixes the problem.

Hope that helps.

Author’s gravatar

Hi – thanks for this – worked second time – must have done something wrong first time around – will have a look at your Amazon wishlist!

Reply
Author’s gravatar

Hi Mark,

Glad it worked the second time round. 😉

There isn’t much on the wishlist at the moment, if you can’t find anything feel free to donate as an alternative, if you still want to help out.

Author’s gravatar

I love your blog.. very nice colors & theme. Did you
make this website yourself or did you hire someone to do it for you?
Plz reply as I’m looking to design my own blog and would like to find out where u got this from. thanks

Reply
Author’s gravatar

[echo ‘thank you, thank you, thank you I’ve been looking for ages for this!’]

Reply
Older Comments
Newer Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

I'll keep your WordPress site up-to-date and working to its best.

Find out more