简体   繁体   English

Constancemart购物车计时器

[英]virtuemart cart timer

Please help, don't really understand joomla + virtuemart. 请帮忙,不要真正了解joomla + Constancemart。 If we want to put a timer when user add to cart, so, and product will be unavailable for another user, can give a rough illustration how to do that? 如果我们想在用户添加到购物车时放置一个计时器,这样,另一个用户将无法使用该产品,可以粗略说明该怎么做?

So, if within that timeframe, user still no checking out, then the product will be removed from his cart, and become avail again. 因此,如果在该时间段内,用户仍然没有退房,则该产品将从其购物车中取出,然后再次变为可用状态。

Each product in VirtueMart has an "In Stock" property; VirtueMart中的每个产品都具有“库存”属性; this is in the "Product Status" tab. 这是在“产品状态”标签中。

Under Admin -> Configuration in VirtueMart admin, in the section "Core Settings", there's an option called "Check Stock". 在VirtueMart管理员中的“管理”->“配置”下,“核心设置”部分中有一个名为“检查库存”的选项。 If enabled, the user will not be able to check out if they try to buy more units than are in stock. 如果启用,则用户将无法签出购买数量超过库存数量的商品。

So, say there is 1 unit left and Alice puts it in her cart, then decides to go for dinner or something. 因此,假设还剩1个单位,爱丽丝将其放入购物车,然后决定去吃晚餐或其他东西。 Bob comes to the site, sees the same item, puts it in his cart and then checks out. 鲍勃来到该网站,看到相同的物品,将其放入购物车,然后结帐。 Bob is successful; 鲍勃成功了; order is sent to him. 命令被发送给他。 When Alice gets back, even though the item is in her cart, it won't let her check out because the "In Stock" quantity is now zero. 当爱丽丝回来时,即使该物品在她的购物车中,它也不会让她签出,因为“库存”数量现在为零。

Make sense? 说得通?

Now it solved. 现在解决了。

Just edit the code for virtual mart plugin and store the cart time in session. 只需编辑Virtual mart插件的代码并将购物车时间存储在会话中即可。 And use javascript module to pull from server whether any product expired, if does, then just remove it. 并使用javascript模块从服务器获取是否有任何过期的产品,如果过期,则将其删除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM