NOP CART

I think it was back around 2003 when I was asked to create a website with a shopping cart to enable online credit card sales. I knew absolutely nothing about shopping carts, and to add to the challenge there was no money to spend on a professional solution. I was pretty sure that I couldn't do it.

Then, almost by accident, I found a link that said "free shopping cart" which brought me to the NOP Cart. Three things immediately appealed to me: the price, the fact that the Cart was written in JavaScript, and the price. While JavaScript is not one of my strengths, it seemed quite an accessible option for me compared to a PHP or Perl cart and I figured that I could get it working.

To cut a long story short it was surprisingly easy to make the cart work, essentially by copying and pasting lots of HTML from the sample web site and customising it to my own needs. I had an extra trick to overcome because the eWAY payment gateway required the purchase amounts to be in cents (i.e. $10.00 = 1000), but with the support of the good folks at HTMLfixIT we were able to make a few modifications to the JavaScript and make this work (the code is shown below). The site MattMan has been happily accepting credit card sales ever since.

Colourful shopping carts. Image source: WikipediaGetting the shopping cart up and running felt like a massive break-through, so I put together a JavaScript Shopping Cart tutorial to try to show the way to others. This article has been posted at HTMLfixIT for a number of years, and has almost taken on a life of its own. It gets a ton of traffic, is well placed in search results, and holds a respectible Google Page Rank. I get many requests for advice and assistance from people who have found the tutorial and are looking for further support, but with only limited time I regret that e-mail support is not something that I can readily provide. Instead, my advice and support follows..........

Check these vitally important links:

I would encourage all potential users of the cart to save a copy of the NOP Sample Site and play around with the code, to understand how to make the cart work and also what breaks it. In between the instructions, trial and error, and searching the forum archives for previously asked questions, most (if not all) challenges can be overcome.

You'll be pleased to know that the wonderful people on the NOP Support Forum are far more knowledgable and resourceful than I am. My only advice is that before posting a question to the forum be sure to search the archives for the answer first. You could save a lot of people (including yourself) a lot of time if someone has already been there and done that with the same problem.

For people using the eWAY payment gateway and needing to configure the cart to convert dollars and cents to only cents, insert the following code into the JavaScript file "nopcart.js" (I suggest around line 380 just before the function named "MoneyFormat", for the sake of good order).

//---------------------------------------------------------------------||
// FUNCTION:    CentFormat                                             ||
// PARAMETERS:  Amount to be formatted to cents                        ||
// RETURNS:     Cent amount of transaction                             ||
// PURPOSE:     Reformats Dollar amount to cents for eWAY              ||
//---------------------------------------------------------------------||
function centFormat(input) {
   var dollars = Math.floor(input);
   var tmp = new String(input);

   for ( var decimalAt = 0; decimalAt < tmp.length; decimalAt++ ) {
      if ( tmp.charAt(decimalAt)=="." )
         break;
   }

   var cents = "" + Math.round(input * 100);

   return(cents);
}

MORE CARTS

A lot has changed since I first used the NOP Cart. Back in 2003 it seemed that there were no easy "off the shelf" solutions for a shopping cart unless you were a really sharp coder or could afford somebody who was one. But times have changed and these things have become more accessible.

If I were starting over again now I would probably check out osCommerce and Zen Cart which both appear to be comprehensive and free options.

I haven't used either so can't speak with first-hand experience, but note:

  • Both are easy install options already sitting there and waiting if your web host uses a cPanel;
  • Both are open source projects, supported by a community of people dedicated to improving the programs;
  • Both have extensive websites oozing with tools, add-ins, resources and support.

This is all pretty encouraging to me. If you have any experience with these carts or know better ones, please let me know details and I'll look to update this.

PAYPAL "BUY NOW" BUTTONS

A shopping cart is a great tool, but can be over-kill where the site and product range are modest. PayPal offers a free tool called BUY NOW Buttons and also a complete shopping cart solution.

PayPal - Click here to pay PayPal - Click here to buy

I really like these because they are easy to configure, and take customers directly to PayPal's secure site for a credit card transaction. That way you don't need to carry the overhead of a payment gateway, merchant fees and other bank fees which may be payable even if you don't achieve any sales during a month.

I have configured PayPal "BUY NOW Buttons" on the Storm Trumpets web site to great effect.

VISITOR COMMENTS

Got a view or opinion on this subject? Please feel free to add your thoughts to this topic.

Please check the "Rules of Engagement" before submitting, and note:

  • Comments are moderated, and only added to this page after approval;
  • HTML tags are automatically stripped from comments and will not appear;
  • Comments are restricted to 1500 characters (that's around 200 words for most people).

 


 

Hi,
I went through your article on implementing ecommerce site with shopping cart and payment gateway services. It is really good for beginners in ecommerce site development. I appreciate your work!!

Thanks and Regards,

Soft Programmer
- Saturday, 03 May, 2008 at 16:06:04 (AEST Australia/NSW)

 

Your Name: 
Your Website: 
Your Location: 
Comments: 

Maximum 1500 characters

Submissions containing any of the following will be rejected:

  • Adult content, or links to any such content;
  • Offensive language;
  • Anything that looks or even smells like advertising;
  • Comments which have potential to offend, degrade, intimidate, or incite violence or prejudicial action against a person or group of people based on their race, gender, age, ethnicity, nationality, religion, sexual orientation, gender identity, disability, language ability, moral or political views, socioeconomic class, occupation or appearance (such as height, weight, and hair colour), mental capacity and any other distinction.

Steer clear of these and we'll all remain happy!

Naturally I accept no responsibility or ownership of news or views submitted by others. If you believe that there is sensitive or damaging material within website comments please contact me and I will review / remove it.