PDA

View Full Version : Amazon Store Integration


mikelbeck
09-19-2005, 10:00 PM
This is my first mod for vBulletin, so take it easy on me if I've done something incorrect...

Anyway, this is an Amazon store integration mod for vB. One of my sites is job/career oriented, so I offer books that are related to this through this mod. It will pull all of the items in a particular category (Amazon BrowseNode) and display them for users to pick & choose what they want. They can add the items to a remote Amazon shopping cart, and when they're finished shopping they can check out through Amazon.

Note that only logged in users will be able to add item to their carts.

See the attached file "install.txt" for installation instruction.

You can see it in action here:

http://www.discusscareers.com/book_store.html

Let me know what you think, have any problems, questions, suggestions, etc.

Reeve of shinra
09-20-2005, 02:17 PM
Thank you for releasing this. I need to get the dev ID but I will be installing this later.
(btw the mods will ask you to add the instructions to a text file)

Reeve of shinra
09-20-2005, 02:22 PM
Quick question for you....

Say you wanted to have two product catagories, 1 for say books and another for games, would this hack be able to do it?

mikelbeck
09-20-2005, 02:25 PM
Quick question for you....

Say you wanted to have two product catagories, 1 for say books and another for games, would this hack be able to do it?

Not just yet, it only pulls one at a time. I'll look into how that could be done, though.


(btw the mods will ask you to add the instructions to a text file)

Which instructions? The code changes? Template additions? Or everything?

Cyricx
09-20-2005, 03:21 PM
Everything :)

Just cut and paste your post to a text file and if you want create a zip file with it and the php file and upload the zip :)

mikelbeck
09-20-2005, 03:42 PM
Everything :)

Just cut and paste your post to a text file and if you want create a zip file with it and the php file and upload the zip :)

Done, I uploaded "install.txt" which contains the install instructions.

bigcurt
09-22-2005, 12:14 AM
Great man, I believe I asked for you to release this a while back, it looks very good

/me installs

~Curt

mikelbeck
09-22-2005, 12:22 AM
Great man, I believe I asked for you to release this a while back, it looks very good


* bigcurt installs



~Curt

Ya, I kind of remember you asking for this, I didn't really have it finished to my liking until this week.

I found how to do a generic search, I'm going to try to integrate that with a context-sensitive link in threads, a "click here to search amazon for items related to xxx" sort of thing.

Has anybody who has installed this found any problems with it? Have any questions, comments, suggestions?

Can you post links to where you've installed it?

I realized after I posted it here I should've put my name on the template somewhere... I guess when I update it I'll put a copyright line on it, hopefully those who've installed it will make that change. ;-)

Guest190829
09-22-2005, 01:48 AM
Would love to see this in 3.5. :) I will test it out on my 3.0.x board if you need it.

mikelbeck
09-22-2005, 01:58 AM
Would love to see this in 3.5. :) I will test it out on my 3.0.x board if you need it.

I'll port it to 3.5 soon after it's released.

If you could test it on you 3.0.x board, I'd appreciate it.

xug
09-24-2005, 01:34 PM
Mikelbeck, the page you link to and when I browse through the 'store' it gives an error, syntax error in line 2 in the html pages.

mikelbeck
09-24-2005, 03:36 PM
Mikelbeck, the page you link to and when I browse through the 'store' it gives an error, syntax error in line 2 in the html pages.

Thanks, I hadn't noticed that.

I don't see anything wrong with "line 2", though, I'll have to look further.

mikelbeck
09-24-2005, 04:18 PM
I can't find anything wrong with what it's referring to.

However, I did find one error, and have one addition. I've changed the "install.txt" at the beginning of this thread. Here's the changes.

In the amazon_store template:
find:

$amazon_store_header_listbit
</table>


add after:

<tr>
<td>
<div class="smallfont" align="center">
Amazon Store for vBulletin version 1.0.0<br />
Copyright &copy 2005 by <a href="http://www.elite-computing.net" target=_blank>Elite Computing Services</a>.
</div>
</td>
</tr>


In the amazon_store_data_listbit template:
find:

<else>


replace with:

<else />


If somebody would like to take a look at the page and try to figure out what the syntax error is all about, have at it.

It doesn't occur on the main page, only the inside pages. This one (http://www.discusscareers.com/book_store.html) is fine, but this one (http://www.discusscareers.com/book_store/page_2/category_2572/sort_salesrank.html) reports:


Line: 2
Char 1:
Error: Syntax Error
Code: 0
URL: http://www.discusscareers.com/book_store/page_2/category_2572/sort_salesrank.html

hbalagh1
09-25-2005, 03:32 AM
great little mod installed here
http://www.daycareforums.com/book_store.html

some kind of search feature (if possible) would be great

hbalagh1
09-25-2005, 04:18 AM
ohh , i found some kind of goof up :)
when i click on a book to read more info then try and go to the navbar i get links like this
http://www.daycareforums.com/book_store/page_1/category_4/sort_salesrank/get_detail/login.php?do=logout&u=1

instead of links like this

http://www.daycareforums.com/login.php?do=logout&u=1

any clue of what i may have done?

mikelbeck
09-25-2005, 11:22 AM
ohh , i found some kind of goof up :)
when i click on a book to read more info then try and go to the navbar i get links like this
http://www.daycareforums.com/book_store/page_1/category_4/sort_salesrank/get_detail/login.php?do=logout&u=1

instead of links like this

http://www.daycareforums.com/login.php?do=logout&u=1

any clue of what i may have done?

Your navbar is using relative links, for example:


<a href="login.php">


Add "$vboptions[bburl]/" to the front of the link to correct it:


<a href="$vboptions[bburl]/login.php">

hbalagh1
09-25-2005, 06:18 PM
thanks

hbalagh1
09-25-2005, 06:39 PM
A couple of request :)

Is there a way to have bigger thumbnails when your viewing pages (before you click on the product to read more)

And possibly have 3 rows across instead of just the 2....looks a little empty :)

and when you view your cart if there can be a link to continue shopping :)

mikelbeck
09-25-2005, 07:01 PM
Here's a fix... The image displayed is supposed to be the medium image, the code for that got all screwed up. Also the title isn't displayed.

In amazon_store_data_listbit, find:

<if condition="$SmallImage">
<a href="/book_store/page_$page/category_$category/sort_$sort/get_detail/item_$ASIN.html"><img src="$SmallImage" border="0"></a><br />
<else />
<a href="/book_store/page_$page/category_$category/sort_$sort/get_detail/item_$ASIN.html">$Title</a><br />
$Author<br />
</if>


Replace with:

<if condition="$MediumImage">
<a href="/book_store/page_$page/category_$category/sort_$sort/get_detail/item_$ASIN.html"><img src="$MediumImage" border="0"></a><br />
<else />
<if condition="$SmallImage">
<a href="/book_store/page_$page/category_$category/sort_$sort/get_detail/item_$ASIN.html"><img src="$SmallImage" border="0"></a><br />
</if>
</if>
<a href="/book_store/page_$page/category_$category/sort_$sort/get_detail/item_$ASIN.html">$Title</a><br />
$Author<br />


In amazon_store, find:

Amazon Store for vBulletin version 1.0.0<br />


Replace with:

Amazon Store for vBulletin version 1.0.1<br />


I'll update the install.txt file, and will have some more fixes coming later today or tomorrow morning:

- Add a "continue shopping" link.
- Straighten out the boxes on the main page, they're not lined up properly.
- Guests can add items to their cart, apparantly, that's not supposed to happen.
- The page description & keywords are screwed up.

hbalagh1
09-25-2005, 07:11 PM
great, i also wonder if there is a way to show a subtotal somehow?

mikelbeck
09-25-2005, 08:08 PM
great, i also wonder if there is a way to show a subtotal somehow?
A subtotal of... the items in the cart? I could add that.

mikelbeck
09-27-2005, 02:55 PM
I've got a bunch of fixes completed, I'm hoping to have the rest done today.

Completed:
- No more than 250 pages can be requested, but this app would keep going forever, allowing the user (or a spider) to keep requesting past page 250 but nothing would be displayed. Now it will stop at page 250 and won't display the "Next" link.
- Corrected the page description, keywords & title.
- A user on a detail page wasn't been shown properly in "Who's Online"
- Added a subtotal to the cart page
- In some cases, after adding an item to the cart the "items in cart" wasn't updated immediately.
- In some cases, guests could add items to the cart.

In Progress:
- Once I added the subtotal to the cart page, I found that the price displayed was wrong.
- Add "Continue Shopping" link to the cart, and have it go back to the last page displayed.
- Straighten out the boxes

mikelbeck
09-27-2005, 06:29 PM
I've updated the files attached to this mod with the latest & greatest.

Fixes in 1.0.2 include:

- No more than 250 pages can be requested, but this app would keep going forever, allowing the user (or a spider) to keep requesting past page 250 but nothing would be displayed. Now it will stop at page 250 and won't display the "Next" link.
- Corrected the page description, keywords & title.
- A user on a detail page wasn't been shown properly in "Who's Online"
- Added a subtotal to the cart page.
- In some cases, after adding an item to the cart the "items in cart" wasn't updated immediately.
- In some cases, guests could add items to the cart.
- The price displayed were wrong.
- Added "Continue Shopping" link to the cart, and have it go back to the last page displayed.

Still left to do, for the 1.0.3 version:

- Straighten out the boxes on the main page.

To upgrade from 1.0.1 to 1.0.2 (the latest), download the amazon_store.php file and replace the one you already have.

Then, make these few changes:

In functions_online.php
Find:

case 'book_store.html':
$userinfo['activity'] = 'amazon_store';
break;


Add after:

case 'sort_salesrank.html':
$userinfo['activity'] = 'amazon_store';
break;


In the amazon_store template
Find:

In Cart -


Replace with:

In Cart ($CartSubTotal) -


Find:

<a href="$PurchaseURL" target=_blank>Checkout</a>


Add after:

<if condition="$cart_title">
- <a href="/book_store/page_$page/category_$category/sort_$sort.html">Continue Shopping</a>
</if>


Find:

Amazon Store for vBulletin version 1.0.1<br />


Replace with:

Amazon Store for vBulletin version 1.0.2<br />

hbalagh1
09-27-2005, 06:59 PM
i get this 1 Item In Cart () instead of a price in it...and my continue shopping link doesn't show up :(

mikelbeck
09-27-2005, 07:14 PM
i get this 1 Item In Cart () instead of a price in it...and my continue shopping link doesn't show up :(

Did you replace your amazon_store.php file with the one attached to the beginning on this thread? In addition to those two problems, it looks like your store is still showing the wrong prices, I think you're running old code.

hbalagh1
09-27-2005, 07:17 PM
lol, ohh my im a dork... hahah

i downloaded the most recent php file at the top, and saved it to my docs, made the changes (as needed for my store) and uploaded the old one back up instead of the new one...i normally save everything ot my desktop

my bad, so sorry

mikelbeck
09-27-2005, 07:20 PM
lol, ohh my im a dork... hahah

i downloaded the most recent php file at the top, and saved it to my docs, made the changes (as needed for my store) and uploaded the old one back up instead of the new one...i normally save everything ot my desktop

my bad, so sorry

That's quite alright, I do that sort of thing all the time.

I think I PM'd you on your site with the same info... If it wasn't you then I'm bothering one of your users and they won't have a clue what I'm talking about. ;-)

Scribbller
10-18-2005, 07:07 PM
Mikel can we add categories to it?

mikelbeck
10-18-2005, 07:17 PM
Mikel can we add categories to it?

You can change the category, the instructions for doing that are in the install.txt file.

mikelbeck
01-07-2006, 12:55 AM
Is anybody using this? Should I update it from 3.5?

twobob
04-18-2006, 09:03 PM
This looks great! Update it to 3.5 and I'll certainly be using it! Cheers, twobob

redlabour
05-11-2006, 08:43 PM
I'll port it to 3.5 soon after it's released.


Anything new about this ? I hardy miss it. :surprised:

RichieBoy67
10-30-2007, 07:03 PM
What's going on with this anyhow? I managed to embed the rat version here but it isn't something that could be released as a mod. This still needs some cleaning up too. I am actually hoping someone will still release something better.. I would be willing to help out..

Store Embed (http://www.talkandmore.net/store/amazon_products_feed.cgi)

mikelbeck
10-30-2007, 09:02 PM
I've got a 3.6.8 version that should be out within another couple of days. See this thread: https://vborg.vbsupport.ru/showthread.php?t=105164&page=2

mikelbeck
10-31-2007, 01:03 AM
The 3.6.8 version is now available here: https://vborg.vbsupport.ru/showthread.php?p=1372422

RichieBoy67
10-31-2007, 04:11 PM
Thanks!! Can't wait to get that going...

Let me know if you need a demo site or anything. I should have this up today at some point..

Thanks again,

Rich