Ask HN: What is a shopping cart and why wouldn't I just write my own?
Hi HN-
I'm having trouble understanding a very basic concept. I build an online store, and since I'm a programmer, I let the user collect their items in a table associated with their session id. Then, I compute the order total. My server goes to the payment gateway server and charges the credit card. Then I ship stuff. What is the purpose of a shopping cart and why would I pay for a 3rd party one? They all appear to require some kind of programming, but if I already know how to program, why wouldn't I just build my own?
Note: I'm not being a smart-ass, I really don't understand what I'm missing, but I'm obviously missing something. Can someone explain what a shopping cart is to an e-commerce newbie?
Thanks for any help, Karl
16 comments
[ 3.0 ms ] story [ 37.9 ms ] threadSome of the other features of a shopping cart
1. Integration with a checkout system (Single page Vs Multi Page) - this is itself a demon in itself.
2. Bells and Whistles on the cart itself like tax & shipping cost estimator
I guess when you say you can create a shopping cart in 15 mins you are not keeping in mind any checkout flow integration or estimators or much control with items in the cart e.g. changing sku options like color etc.
There are some open source systems like Magento which can be looked at too.
I was involved with an ecommerce startup that built all of this from scratch to control everything legally and then sell it, and quite honestly, it is an absolutely incredible amount of work.
Usually, it is easier to find software that's already been written to meet your needs unless you're trying to create a unique value proposition in some way.
If you're building a standard e-commerce site, it might make sense to use some software package that's prebuilt with what you need.
Either way, if you think you can do it in 15 minutes and want to build it, have fun with it and do it yourself.
There are a lot of features an simple online shop might want to use. Cart is used as a general term
It's product management and categorising, product options, coupons and discounts, multiple tax rates, bulk buy discounts, user registration, payment gateway integration, promotions, image galleries, I could go on.
Basically when you buy an off the shelf system like zen cart, you're getting an entire e-commerce site that you just configure and style. And even if it's not a full site, but a PHP library to interface with your own site, it's a lot more than just the action of storing product id's and quantities in a session.
Absolutely you can roll your own, but unless you have a really defined and limited product range it's just likely your needs will scale more quickly than your code, is all.
And all the other points about it needing more functionality than you'd expect.