Using AJAX In An E-Commerce Store

posted on 2005-08-03 at 00:13:40 by Joel Ross

First, some background. Tim Haines is starting a blogversation about how the use of AJAX can improve a user's online shopping experience.

I'm going to write this post in two parts. The first part will be without looking at any of the other responses, and just tossing out ideas that I think could be beneficial. If there's a page on Tim's demo site that this would apply to, I'll link to it.

For the second part, I'm going to read through some of the responses I've seen, and highlight the ideas that I agree with, or maybe even those I don't. We'll see. I haven't read the responses yet!

Anyway, if you want to join the blogversation yourself, you can find the details here.

Ok. Part one. I've surfed the demo site a little bit and I'm ready to comment on what I think would be good to add. I'm probably going to be listing more than you would want to implement, but taken in moderation, I think each of these would be great.

First, adding items to your cart. Use AJAX. On a product page (and others), you have a shopping cart on the left side navigation. When you click the plus button, AJAX could add that to the left hand navigation, as well as adding it to your cart on the server without a page refresh.

Next, once you have your items in the cart, why not be able to sign in using AJAX? Give me a login box, and log me in automatically. I'm not sure that registering would be a good option, but logging in certainly could be.

Now that you're logged in, and added items to your cart, it's time to check out. On the checkout page, the obvious one is updating your cart. When you update quantities, everything can be done without posting back. The demo site doesn't offer it, but most shopping sites will calculate taxes and shipping charges based on your zip. You could do that through AJAX too, so you can get an accurate view of your costs easily.

So that's the shopping process. Overall, though, if you have a very dynamic site, where things change fast, then you could have a side bar of some of the newest or hottest deals that update on a given interval. Or, if you're a site like eBay, then you could include all of the user's current bids and how they are doing.

Ok. There's my suggestions. Pause with me, while I read the feedback Tim's gotten so far.

There's only a few unique ideas, and I can cover them by highlighting Keith Nicholas' post. The others are in line with what I suggested, or are in line with what Keith suggested. He mentions up-sells. Good idea! Based on your cart's contents (which are added using AJAX), you can also check to see what else might interest the user and display those items. His second suggestion I disagree with - loading the details page using AJAX. Why? If you have to browse to it through categories, then you can't bookmark a product, which means you can't send the link to friends. Also, the comments are telling. Rick Strahl points out that downlevel browsers need a different experience, which means doubling your coding effort.

So, now that I've put all this out, why did I do it? Well, why not? AJAX is hot right now, and exploring what I think are good uses of AJAX is a good exercise, as is seeing how others view the use of AJAX. I'm definitely not sold that AJAX is a good thing to use everywhere, but it has it’s uses. It's also interesting to hear about features from developers. I think we have a different perspective on them than a business analyst would. We think in terms of implementation rather than features ("How would you do this?" vs. "Would someone use this?"). Oh yeah, and the $150 gift certificate!

Categories: Development