Live data from Hacker News

Ask HN: What is a shopping cart and why wouldn't I just write my own?

news.ycombinator.com

11–17 of 17 posts

Re: Ask HN: What is a shopping cart and why wouldn't I just write my own?

#11
I think you're misunderstanding what an off the shelf shopping cart is. It's not just a way of storing the items a user has chosen along with their quantities, like you say, all that requires is a session array.

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.

Re: Ask HN: What is a shopping cart and why wouldn't I just write my own?

#12
Because you're going to get it wrong. No offence intended, I would too, but if you haven't been sleeping, eating, breathing security for a while, you're going to make a mistake, and it'll cost people.

And all the other points about it needing more functionality than you'd expect.

Re: Ask HN: What is a shopping cart and why wouldn't I just write my own?

#13

I think you're misunderstanding what an off the shelf shopping cart is. It's not just a way of storing the items a user has chosen along with their quantities, like you say, all that requires is a session array. 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 g…

wow, thanks Matt. This is the answer i have been waiting for. this is my misunderstanding. i get it now, it's not that a basic shopping cart isn't trivial, it's that it quickly expands to a full time job. thanks for enumerating specifics.

Re: Ask HN: What is a shopping cart and why wouldn't I just write my own?

#14
post #4

Earlier quoted context omitted.

See, this is what I don't understand. Building a shopping cart is like 15 minutes of work if I'm already building my own e-commerce site, isn't it? Are 3rd party shopping carts for non-programmers? I mean, as far as I can tell, it's literally just a session-associated table of items. What else is a shopping cart besides that? Why would I spend 2 days reading the "Zen cart" manual and API when I can finish my home bre…

Robert Morris wrote Viaweb's shopping cart. He is a smart programmer, and he found it nontrivial. Years later he was still encountering bugs from weird combinations of user actions.

Dell finds it nontrivial as well. I just used their shopping cart. At one point it wiped out the entire contents of my cart when I added an item from a different section.

Re: Ask HN: What is a shopping cart and why wouldn't I just write my own?

#16
post #6

Earlier quoted context omitted.

Well, to expand on that, a lot of people don't just use the shopping cart, but all of the combined stuff like payment processing, the CMS for adding in products, user accounts, built-in APIs and many other features. 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…

ah, ok, this make sense. So, the ecommerce programmer would write all of the catalog stuff, then hand it over to a 3rd party shopping cart for payment, coupons, taxes and shipping, etc.? is that that non-trivial part?

- web based admin interface - Creating a browseable catalog - integration with various payment options - promotions, coupons, sales - shipping related features - CMS/website builder features

There are a lot of features an simple online shop might want to use. Cart is used as a general term

Re: Ask HN: What is a shopping cart and why wouldn't I just write my own?

#17

I think you're misunderstanding what an off the shelf shopping cart is. It's not just a way of storing the items a user has chosen along with their quantities, like you say, all that requires is a session array. 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 g…

wow, thanks Matt. This is the answer i have been waiting for. this is my misunderstanding. i get it now, it's not that a basic shopping cart isn't trivial, it's that it quickly expands to a full time job. thanks for enumerating specifics.

I would also add that an off the shelf cart system will come with a fully fledge back end. This is nice because you can make use of reusable product options, discounting, automated email receipts, etc. But it's even nicer because you can get admin reporting like month to month sales figures, daily totals, most popular product rankings, and running discount totals. Sure you can track this in Excel but the point is that you don't have to. The ability to update, adjust and refund orders from an interface integrated with the store is nice, too.

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.

Post reply on HN