We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
我曾经想过这个,但从未编程过。
不管它的价值如何,我会做的就是在一个物体即将完成付款过程时暂时“保留”该物体。这样一来,其他人就无法购买这个Object了。当它处于保留状态时,我会给出用户可以保留它的时间期限(也许一个小时)。然后,只有付款有效,产品才会从库存中移除。
I've thought of this but never programmed it.
For whatever it's worth, what I would do is put a temporary "hold" on an object if it is about to go through the payment process. In this way, no one else could buy this Object. While its on hold, I'd give a expiration to how long a user can hold it ( Maybe an hour ). And then only if the Payment was valid would the product be removed from stock.
通常情况下,您会将库存分开,这样您就可以为仓库中的物品提供一个值,并为已提交但未发货的订单提供一个值。
当将商品放入购物车时,您所能做的就是在有效库存发生变化时(即其他用户提交订单时)通知用户。在购物车结帐之前,没有任何保证。
Well normally you keep inventory separated such that you have one value for what is in the warehouse and one value for submitted but not shipped orders.
When an item is placed in a shopping cart all you can do is inform the user when the effective inventory changes, i.e. when another user has submitted an order. There are no guarantees until the cart has been checked out.