购物车储备产品 [英] Shopping Cart reserve product

查看:101
本文介绍了购物车储备产品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据此问题此处,一个人如何在一个产品中保留产品用户何时付款购物车?如果用户放弃购买并且没有回到您的站点该怎么办,如果不重新加载页面,您将如何保留该产品.为此,您将如何首先保留产品?我正在使用php mysql和使用Paypal Web付款标准创建购物车. 谢谢

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

推荐答案

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

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.

这篇关于购物车储备产品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆