购物车预留产品

发布于 2024-08-12 19:43:03 字数 231 浏览 2 评论 0原文

此处这个问题之后,如何在购物车中预订产品用户去付费?如果用户放弃购买并且没有返回您的网站怎么办?如果页面没有重新加载,您将如何取消保留产品。就此而言,您首先会如何预订该产品?我正在使用 php mysql 并使用 paypal 网络支付标准创建购物车。 谢谢

Following on from this question here, how does one reserve a product in a shopping cart when a user goes to pay? What if the user abandons the purchase and does not come back to your site, how will you unreserve the product if the page is not being reloaded. For that matter how would you reserve the product in the first place? I am creating a cart using php mysql and using paypal web payments standard.
Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

幻想少年梦 2024-08-19 19:43:03

一个适合我们的干净解决方案是使用“内部订单”类型的系统。产品表将保存产品详细信息以及现有库存。当用户预订产品时,我们将其视为内部订单,因此在订单表中,您将拥有用户预订的商品以及预订的日期和时间。然后,您可以根据用户保留的单位数量减少产品表中的库存数量。

然后,您可以每晚检查尚未转换为发票的内部订单,然后从数据库中删除它们,根据保留但未开具发票的单位数量增加产品表中的库存数量。

然而,如果使用最终完成了购买,则该项目将简单地转换为发票。在某些情况下,我们对发票和订单使用同一个表,并通过一个简单字段指定记录是发票还是简单的内部订单。

A clean solution that works well for us is to use an "internal order" type system. The product table would hold the product details as well as the stock on hand. When a user reserves the product we treat it as an internal order, so in an order table you'll have the item that the user has reserved and the date and time that it was reserved. You can then decrease the stock quantity in your product table based on the number of units the user has reserver.

Then you can on the nightly basis for example check for internal orders that have not been converted to invoices and subsequently remove them from the database increasing the stock quantity in your product table based on the number of units that were reserved but not invoiced.

If a use however ends up completing the purchase the item is simply converted to an invoice. We use the same table for both invoices and orders in some instances with a simple field that specifies whether the record is an invoice or simply an internal order.

北斗星光 2024-08-19 19:43:03

我也需要这个答案,使用 asp.net 和 MS Sql。问题是,您需要标记 SQL 记录以避免其他人同时保留该项目,但如果第一个用户关闭浏览器,则无法取消保留 sql 中的项目...

I too need this answer, with asp.net and MS Sql. Problem being, you need to flag the SQL record in order to avoid others reserving the item at the same time, but if the first user closes the browser there is no way to unreserve the item in sql...

此岸叶落 2024-08-19 19:43:03

您可以创建一个定期运行的 cron 作业,检查是否有任何未及时付款的预订项目(例如,预订后 24 小时内)。

You can create a cron job that will run periodically and check if there are any reserved items that have not been paid for in time (for example, within 24 hours from reservation).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文