How to Add an Amazon aStore to your WordPress Theme
88Amazon Store for WordPress
To date, I have 8 websites. One is a growing article directory which I made Hubpages and Squidoo easy for fellow authors. One is my business website and the rest are Niche sites using Wordpress themes. None of my sites have stores on them, well that is until now. I’m in the process of creating a new site and decided this would be a good time to try and integrate a store into the site navigation. My only requirement is that the store has to look as if it is part of the website. I don’t want my visitors to navigate away from my site to make any purchases.
Whoever thought it could be so difficult to add an Amazon aStore to a WordPress theme? The fact is, it’s not that difficult at all. That is, if you have the right information. I spent the better part of the day searching online for information on how to do just that. There is plenty of information on how to add an Amazon store or “widget” to a website and there were a few tutorials on how to add them to Wordpress. But I could not find the information I needed to fit my requirements in one place, hence this tutorial.
First Step to Success
In 6 steps, I’m going to explain how to add your own Amazon store to your self hosted WordPress blog. You won't need to know anything about programing to complete this task, however you should at least be familiar with uploading pages using an ftp client.
Step 1:
Copy the code I provided below into an editor like PSPad which is free, or into notepad, and save it as a .php file.
Do not worry about the line that leads to my store right now, you will be changing that in a later step.
<?php get_header(); ?>
<?php
/*
Template Name: a Store Page
*/;
?>
<?php get_header(); ?>
<!-- Paste your own code below over the example code I've supplied -->
<iframe src="http://astore.amazon.com/howtomakeahor-20" width="100%" height="4000" frameborder="0" scrolling="no"></iframe>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content(__('[Read more]'));?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>
<!-- The main column ends -->
<?php get_footer(); ?>The Rest is Easy
Step 2:
Using your ftp client, upload your new astore.php file into the theme of your WordPress content. Once that is complete, you can close your ftp client and you will not need to go back in for the rest of this procedure.
Step 3:
Log into your Amazon Associate page and select aStore. This is where you will configure the look of your store and decide which products you want to promote. You have a few options, one you can manually choose the products for your store, or you can find a “listmania id” and use the item that are in the list you choose. Personally, I would hand select my items manually.
Once your store is configured the way you want you will be given a choice on how you want your aStore to be displayed. Choose the ‘Inline Frame’ then copy the code that is provided.
Step 4:
Login to your WordPress dashboard and select the theme “Appearance” button, then select “editor.” Now on the right side there will be a list of pages which are part of your chosen theme. Select the Amazon aStore Template (looks something like this: Amazon_astore_template.php) You will know it because you just created and uploaded it.
Step 5: Very important step but I wont mind if you skip it J paste the aStore code that you copied from your Amazon Associate page over the default code that is there. The code that is there will lead to my store. Once your new code is pasted over the default code, update the page with the button below the editor.
Step 6: Navigate back to your WordPress dashboard and select “Page,” then “add new.” Name this page Store or Shop or whatever you like. Down below and to the right there should be a place to select a page template. Use the drop down menu and select “Amazon Store.” Now publish that page.
You Are Done
And that is all there is to it. You will now have on your WordPress theme, a fully integrated Amazon aStore that has the same look and feel of the rest of your website. Now go earn some money!
If you want to see how my new site looks with the new store added to it, Click Here!
UPDATE 1/21/2010: THE CODE ABOVE WAS MISSING A SEMI-COLON ON LINE 7 WHICH WAS CAUSING A SYNTAX ERROR. IT HAS NOW BEEN RESOLVED AND THE CODE ABOVE UPDATED. IF YOU HAVE HAD SYNTAX ERRORS WHEN TRYING TO INTEGRATE YOU aSTORE THEN YOU MIGHT WANT TO TRY THIS AGAIN WITH THE UPDATED CODE. SORRY FOR THE TROUBLES.
vote upvote downshareprintflag
- Useful (21)
- Funny (1)
- Awesome (12)
- Beautiful (2)
- Interesting (1)
CommentsLoading...
Good stuff. A little php is very helpful.
How in the world do you get your code formatted so nicely?
Good information on your hub!!!
Thanks!!
Totally awesome tips! Just posted my store on my blog.
This rocks! IT took me about 5 minutes to get an Astore up and running.
Awesome tips! I had purchased a plugin to do the job. Wish I had known this several months ago. Could have saved me some cash! :)
Nice clearly laid out set of instructions there that are simple to follow. Good Job! :)
Yes, good idea and good hub. You may want to check out the 'archives' on the right hand side of your articles page, I got an error when navigating to it. It might just be my setup though. Cheers.
This is really simple to do and can really add to the revenue from your website.
Anyone who cannot find the astore setup page (like me) can find it on 4th one along of the blue tabs on the top of your associates home page. I found it best to create your own list from items in amazon and then create the astore from that list. Searching through all the products in astore setup takes a long time.
Hi i see the a Store Page Page Template (myastore.php and i also see myastore.php (myastore.php But it still just shows a blank white page?
This is easy to do. I added a simple Amazon store to a kids learning website I work on. Adding products to my store is as easy as shopping on Amazon too.
This may be a dumb question, but I am using TextEdit on a Mac for step 1, and it won't let me save as a .php file. It keeps on adding .html after the .php. I can't get rid of the .html. BTW, this is just the instructions we were looking for - thank you so much!
I get this when I hit the preview button...
Parse error: syntax error, unexpected T_DNUMBER in /home/simplem3/public_html/justtherightthings/wp-content/themes/amazing-grace/astore.php on line 8
(Textwrangler worked like a charm, thanks)
I'm new to hubpages and thrilled with all the information that you provide for newbies like me. Great work!
I have executed your instructions to the T but my astore is larger than the allowed space within the theme. I can not for the life of me figure out how to fix it. how can I delete the wordpress them side pars just for the stores page?
Thanks for the great step-by-step instructions. I'd been wondering how to do that. Will give it a try. Again, thanks.
Fantastic post! It's helped me get 90% of the way there. However the theme that I'm using, "Swift" has a right hand column that seems to get in the way. It's the same on all pages: http://www.outdoorgearadvisor.com. Any recommendations for how to get the right hand column not to show on my store page?
Thanks! -David
Thanks for the quick response! I had not published the page since I was still having issues with it. Here it is:
http://www.outdoorgearadvisor.com/store/
I also tried this recommendation: http://swiftthemes.com/forum/topic/please-help-my-
but still had an issue with the store only appearing in the left hand column. In the latter case the right hand column was blank.
Thanks again! -David
Hi Richard, thanks again for all of the tips. I'll try going through the process again later today, and hopefully that will do the trick.
-David
Hi Richard! After more tinkering and reading online I was somehow able to get it to work! Very excited. Thanks for your help. http://www.outdoorgearadvisor.com/store-2/
Cheers,
David
I am also getting the error (Parse error: syntax error, unexpected T_DNUMBER in /home/afzalb/public_html/bestfrenchfacial.com/wp-content/themes/red-light/astore.php on line 8) despite uploading/amending file numerous times and following instructions step by step. Very frustrating!!!
Thanks this will save me much research! I also enjoyed following the link to one of your sites - some interesting ideas and inspiration. Many thanks - Mark
livewithrichard, you're wrong with your assumption about Cantona7 as I have that same problem.
it's clearly not as straightforward as you suggest for everyone.
I copied your code EXACTLY more than once and I get that error.
Feel free to try on my blog for yourself and you will see.
Great advice and thanks for providing the code!
Thanks for this, Richard. I haven't tried it yet but I was wondering if this store is strictly for Amazon products? Or can you add products from elsewhere too? I would imagine not since it has the affiliate code to the Amazon store. Does this work within WP E-Commerce plugin? I would also assume that you don't need a shopping cart but what if a person wants more than one of the products in your store?
Thanks, Richard - great information as usual! What you are saying is that I connect the product on Hub pages to my blog - am I understanding that correctly - I would go to my blog, save the URLs for the products, paste them into my Hub pages thus directing traffic to my blog - is that right?
Now as far as the code for the astore is concerned, for others who have already downloaded the code previously, be sure to put a semicolon after the */ on Line 7 so it looks like this: */; otherwise you'll get an error message.
Otherwise this solution works brilliantly - I was so amazed that finally something is easy on the web! Now, if I could figure out if the darn thing works - test it - is there a way to test that the whole system works?
If people are interested they can have a look at what I did - it's not pretty but I have something - that's big for me - http://www.wizetime.com, tab Time Products
hello, ive had success using this little script, but the problem i am having is finding a theme the amazon astore will fit into, i am a novice at best with html, and am failing at editing a theme to remove sidebars, and get the store to fit, can anyone advise me as to any wordpress themes that are compatible with amazon?? ie no editing required?? any help would be muchly appreciated..
cheers jonathon
I really appreciate this information. It saved me from what would otherwise have been hours of work. I do have a question/problem. After following the instructions and loading the astore into the semi-reloaded theme, there are numbers appearing just below the nav bar and above the astore box. Here's what it looks like:2. 3. 4. 9. 10. 11. 12. 13. 14. More numbers appear below the astore near the footer. Any ideas as to what is causing this?
Thanks. Don
Richard - I just used your step-by-step instructions - and managed it too! I'm feeling very hoppy with myself. And I'll tell you how much I knew beforehand ... I didn't even know how to save the copied code to a .php thingy, never mind upload it using filezilas and what not. Yet I did it. Messed with the code too, so that my shop fit my site.
So great hub, mega thumbs up. And thankyou!
Hi Richard. Many thanks for your help. Very helpful and to the point. The training packages I have been subscribing to for the last year didn't help that much. I only wish I could get my head around the rest of it.
Thanks again.
Hi Richard,
I have tried over and over again to create a php file of your code using Notepad. I am calling the file astore.php, but the file saves each time as a Microsoft Picture It file which is essentially a dead program on my computer. In a Google search on how to set up php files, I was advised to put quotations around the file name, which I tried as well, but it made no difference. Can you help?
Thanks.
Susan
thanks man, informative article you rock!
Hurray! I've solved my php file problem (solution: it's supposed to be a Microsoft Picture It file) and have finally installed the astore on my blog. I had the same problem others have mentioned where the astore's side bar is partially cut off. But I easily fixed this by increasing the width code in the astore template from 90% to 103%.
Thanks, Richard, for this hard to find information on adding astores to WP themes. It really is easy and it works! Check out my site's new astore!
Okay gguys need help on this ...... I am using WP launch theme... I placed the store.php in the WP Lanch theme folder... did all of that .. but when i am creating a post... i dont see a option to change to the amazon store theme... any help?
got it to work nvm :P
I have a problem saving the store code as a php file. Whenever I save it in notepad it saves as a txt file and it wont upload to my blog.
Any help would be appreciated.
Richard, I recently started my Astore for a niche site i built, I am very familiar with php and coding but wondered if you find that the Astore converts well for you?
Hope you do not mind -have put a post up on my blog with links back to your site explaining the concept you provided me to integrate a Amazon page-3 links back to your site-are you ok with this?I was so impressed I thought you might like some backlinks-let me know
Awesome info but i have one question, How many a Stores can i install on one wordpress site thanks.. Keep up the great work thanks again :)
Wow it really works !! Thanks a lot buddy
Great article. Step-by-step, I love it! It's one thing to just ramble on about how to do something but when you break it down into steps you really help people understand what they're doing. Props to you!
Nice job
This is great, you've just saved me a bunch of time!
Hi,
Thank you so much for this it has worked brilliantly first time my first real sports blog is surely going to be a hit thanks to you lool!
I also had a problem on the first go round (using headway theme). I FTP using Dreamweaver, which added a bunch of additional code, and it didn't work. Here's how I fixed it ... After I uploaded the astore.php file that didn't work, but I could see it under Appearance/Editor, I completely erased the code that got FTPed, and copied over the code as provided on this website exactly. I then copied my Amazon code, and placed it as instructed. Published it, and BINGO!! Thanks a bundle!!!
Thanks for infos
Wow, this is brilliant. Thank you so much - I've been wondering how to add an Amazon aStore to my Wordpress blog and now I have, in under half an hour. Cheers.
Thanks for this information on adding astores to Wordpress, livewithrichard, I have an astore and a brand new Wordpress site, so will give it a go!
This was exactly what I was looking for - thanks! You saved me a ton of time.
Is there anyway to keep the original page and just change the size of the frame??
Thank you for your great article. Really useful help!
I have put mine on as well =D
Thanks so much, I just used your code on my new store
great hub with lots of information, thanks.
Thanks so much for such a helpful information
Thanks for this info. I just got started with Wordpress so really any type of "cheat sheet" I can get my hands on will prove useful at some point.
Very useful info thanks and have implemented it on one of my sites, although I went to your site to check yours out and got a 404 error.
Hey, I just added my amazon store to my website and it really went well. I really appreciate your effort and want you to know that you're a great help to people like me who are less equipped with programming knowledge. I develop my word press site myself and don't like to pay developers for little changes. And your article here was very helpful in achieving that. Keep up the good work. Be blessed!
Your post on adding an Amazon aStore to a Wordpress blog was excellent!! Thank you sincerely.
I Followed all the steps and changed the code to my amazon store but it still shows your store when I create a page and publish it. How can I fix this?
Thanks! Do you know how to make the iframe no follow or no index?
i like how you elaborated the step by step procedure! thanks man! - http://www.ribit.com/








































dohn121 Level 3 Commenter 2 years ago
Thanks, livewithrichard. I was contemplating on doing this. Thank goodness you did the suffering for me! I will bookmark this and come back to use it. Thanks again.