Shopping Cart

For discussions about game development that does not fit in any of the other topics.
Post Reply
alexrules01
Posts: 175
Joined: Sun Oct 11, 2009 9:33 am

Shopping Cart

Post by alexrules01 »

Hi guys. For my course next year, I will have an actual client and build them a website. This will be the first website I have ever made for someone, as I am wanting to get into Web Design as a career. My client is a friend of mine, and she has told me she wants a shopping cart on her site.

I have been told by the teacher just to use a 3rd party shopping cart, I'm not sure which one they are offering but I have looked at the Zend cart. I had a look in the PHP and it used a lot different things that I have come across while learning PHP. I had a look, because I believe I read that it can be customised, but honestly I wouldn't know where to start!

With this being like an actual job, I wanted to try and do everything myself. From learning PHP from Hall's tutorials, from other members on this site and some online study myself, I believe I could build a basic Shopping cart, but I don't know whether there are other underlying things I am missing. Do you believe a shopping cart is hard? I'm not talking about with all the bells and whistles, just something where people can view products, add to their cart and buy. From their I could start adding more functions. The only problem I have is creating a very secure way of purchasing products (but I believe I can link to Paypal and let the transaction happen their, i have to look into that more).

Sorry to ramble lol, would love some insight though. Oh, and I am not sure what my client wants in the cart, I just know she wants one!
User avatar
Chris
Posts: 1581
Joined: Wed Sep 30, 2009 7:22 pm

Re: Shopping Cart

Post by Chris »

A cart system isn't really all that difficult to build. It revolves more around good database knowledge rather than programming. The reason your teacher is advising you to use one that already exists is because these systems are generally put together by a community of users who make sure it works the best it can. For a client this would be better as if you were to make one there are probably a lot of aspects you might overlook. However for a learning process it would be better for you to build your own.

If you're willing to learn to set up your own, you have to first realize it ins't just going to take a few evenings sitting behind your computer at home, especially not when it comes to production work of a client.

First comes planning, the most important and least fun part when starting off a project. As this system revolves mainly around storing information you'll need a list of things that need to be stored in a database. Section out this information into tables and try figure out how you are going to relate them. After that comes the programming, the only real functionality the program will do is list, modify or delete information from the database, nothing more, nothing less.

To point you in the right direction, picture in your mind walking into a shop. For example walking into the local supermarket. How do you go about doing your groceries?
  • You walk into a shop through the doors (visit the website)
  • You grab a basket or a shopping cart to store your products in (a temporary storage device for products)
  • You navigate your way around the shop and place items in your basket or cart (place products into your storage device)
  • You go to the counter and buy your products (checkout system)
  • You walk home with your product (delivery system)
Most likely you grabbed several different products. They are all stored inside the shop on a shelf down an isle.
Now think of what you did that might be repetitive. For example, if you placed more than one product into your basket.

What do the last two things have in common? They both have something to do with a product. So the product is the main information we want to store. Around the product revolves more information about it. Like the isle it is in, what shelf it is on, what the price is, what the name is and maybe a description. As there are more than one isles, the isles are also something we might want to keep separate.

After figuring how to store the information, think of the functionality of the customer. Like when you use your hand to grab the products and place them into your basket, the program needs to be able to do the same, over and over and over.
What if the product wasn't there? This is also something that could happen more than once.
I could go on all day about functionality.

After the cart system comes a much more complex system. The analysis of the customers to maximize potential profits. Strategic designs and prices to attract buyers to spend as much as possible.

Once you have a system down on paper, it's simply a matter of writing it into codes.
Fighting for peace is declaring war on war. If you want peace be peaceful.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Shopping Cart

Post by Jackolantern »

Yeah, your teacher probably suggested you to use a third-party solution because that is what most professional developers do. The less coding you have to do, the more clients you can service. The more clients you can service, the more money you can make. And of course for the reasons that it is a proven solution that has been properly vetted for bugs. While a shopping cart is not that hard to make, it is also a prime target for e-commerce exploits since most of the actual ordering and billing code is kept walled off. A bug that quietly adds more items to the cart without letting the billing system know could be disastrous.
The indelible lord of tl;dr
alexrules01
Posts: 175
Joined: Sun Oct 11, 2009 9:33 am

Re: Shopping Cart

Post by alexrules01 »

Thanks for a detailed look into it Chris! Yes I should probably write it down, plan it all out- I admit I'm very bad at that, where I just jump in and code.

I think I will attempt at building one, plan it all and design it. I have just under 2 months until my course actually starts, so it should give me enough time to build something that will actually work.

The example you gave, by walking into a store, is actually a good way of looking at it, I never had though of that.

Time to start planning!

@jack- Yea he was getting at that. The only good thing is I will only have the one client for about 5 months, so I can invest my time into the one prject. I am more doing this for a learning experience than anything, and maybe if I don't have one that will be ready for public use, I can continue to develop one so when I am developing for clients, I can use my own.

The security issuses is my biggest worry really, but I will look into at that as it comes up.
User avatar
Torniquet
Posts: 869
Joined: Sun Aug 02, 2009 6:18 am

Re: Shopping Cart

Post by Torniquet »

If you want to learn to build your own, whether its to use or just for the learning curve, i would suggest you sit and watch the tutorials here http://www.developphp.com/view.php?tid= ... _Templates

There are 20 videos which take you from the layout of the site, through the database setup, using paypal and security features.

The bloke who presents thee tutorials is very knowledgeable and walks you through pretty much every aspect of the code
New Site Coming Soon! Stay tuned :D
alexrules01
Posts: 175
Joined: Sun Oct 11, 2009 9:33 am

Re: Shopping Cart

Post by alexrules01 »

Thanks Torn, I appreciate the link. I will start watching tonight, I have a bit of a plan laid out, so these vids will be perfect :)
alexrules01
Posts: 175
Joined: Sun Oct 11, 2009 9:33 am

Re: Shopping Cart

Post by alexrules01 »

I've just been through all 20 videos, no coding, just watched. They are great! He made it look simple :lol:
Plus there were functions and other features I have never seen.
I thought all details would be placed into a database, never thought to use sessions!
Xaleph
Posts: 897
Joined: Mon Feb 07, 2011 2:55 am

Re: Shopping Cart

Post by Xaleph »

First comes planning, the most important and least fun part when starting off a project. As this system revolves mainly around storing information you'll need a list of things that need to be stored in a database. Section out this information into tables and try figure out how you are going to relate them. After that comes the programming, the only real functionality the program will do is list, modify or delete information from the database, nothing more, nothing less.
Loving this paragraph, for it is the most true statement about software engineering you can find. Well.. in case of shopping cart systems that is. The only thing i disagree with is the "least fun" part. Actually, this is where your application begins to get a shape so in a way, the design starts right here and that`s actually pretty cool to do. Sure, database designs, ERDs, KP diagrams etc might be boring but you`ll learn a LOT from doing this.

I trully recommend you do it yourself. Sure, it will contain bugs but thats actually OK for a first project, i mean who remembers their first "professional" website? I`ll bet you 50 hours of coding that anyone here created a buggy first website. And your friend? If he wanted A++ quality, he should invest in it. Quality software usually costs a lot of money. Even the Magento webshops still sell for over 5k here in the Netherlands and Magento is a fully operating, full fledged CMS + CRM for webshops, it`s modular in its design en very flexible. In fact, a Magento shop can be installed within 1 night! Talking about easy money huh?

Anyway, I too wrote my own shopping cart software once and even though the code wasn`t the best ever, it worked like a charm. Every basic functionality was in it, including automated batches for email and .pdf creations and could even export all the data to cvs/excel and plain text. Which helps when filing for taxes.

Point i`m trying to make here is that writing the software yourself will greatly benefit you later on. You`ll learn a lot about database designs and how to use primary and foreign keys, tables and split tables. Writing fast queries and optimizing speeds. This asset is very beneficial for your later webdeveloper/designer career. Most people can easily learn to program ( well.. you know.. script and hack something together) but few people actualy know a thing or two about good database design.
Post Reply

Return to “General Development”