TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

6 点作者 karlrossmann超过 14 年前
Hi HN-<p>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?<p>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?<p>Thanks for any help, Karl

5 条评论

MattBearman超过 14 年前
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.<p>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.<p>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.
评论 #1849806 未加载
mthomas超过 14 年前
Some things your shopping cart might be missing which are non trivial.<p><pre><code> - Coupons or PROMOS ( X% off, $Y off, stackable) - Persisting a shopping cart between visits if an user doesn't checkout. - Saving items from a shopping cart to wishing list and vice-versa - Integration with multiple payment gateways but exposing a single interface</code></pre>
WillyDmz超过 14 年前
You can definitely write your own shopping cart if you want, its just that its a problem that so many businesses have solved before so you'd likely just be wasting time reinventing the wheel when you could be building up other aspects of your business, finding clients, marketing, etc.
评论 #1848636 未加载
patrickyeon超过 14 年前
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.<p>And all the other points about it needing more functionality than you'd expect.
rms超过 14 年前
See <a href="http://news.ycombinator.com/item?id=1607261" rel="nofollow">http://news.ycombinator.com/item?id=1607261</a> for tips about which shopping cart to use