电子商务:智能购物车。
假设一个用户来到我的网站并购买了一个棚屋。棚屋将被添加到购物车中并完成工作。 在我的数据库中,我已经有了棚屋的尺寸(以向客户显示)。
假设客户还想要为棚屋铺一块地毯(你永远不知道),我希望我的 Web 应用程序能够自动了解地毯将用于棚屋,并且只允许用户从下拉框中选择最大平方米棚子的尺寸。我举个例子:
棚=1.83mx 2.44mx 1.55=(宽x深x高) 为了计算平方米,我将宽度和深度相乘 == 4.46 -> 5 将是我的最大平方米变量。 如何根据购物车中的内容更新地毯产品...比如我的棚屋。
感谢您的宝贵时间,并对没有代码表示歉意,我希望您能理解我的意思,我在atm上绕圈子。
Say a user came onto my website and bought a shed. The shed would be added to the cart and job done.
In my database I have the shed's dimensions already (to display to the customer).
Say the customer also wanted a carpet for the shed (you never know) I want my web application to automatically understand that the carpet will be for the shed and will only allow a user to select a maximum square meter from a drop down box based on the dimensions of the shed. I'll give an example:
Shed = 1.83m x 2.44m x 1.55 = (width x depth x height)
To calculate the square meters I'd multiply width and depth == 4.46 -> 5 would be my maximum square meter variable.
How do I update the CARPET product based on what's in the shopping cart... like my shed.
Thanks for your time, and apologies for no code, I hope you understand what I mean I'm running in circles atm.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的访客购物车存储在 $_SESSION 中,您可以让项目页面 (a) 检查 CARPET 是否正在被浏览,如果是,则 (b) 解析 $_SESSION 以查看访客购物车是否包含 SHED。如果是这样,它就可以根据访客选择的棚屋尺寸(也存储在 $_SESSION 中)计算地毯面积。
If your visitor cart was stored in the $_SESSION, you could have the item page (a) check to see if CARPETs are being browsed, and if so (b) parse the $_SESSION to see if the visitor cart contains a SHED. If so, it could then calculate the carpet area based on the visitor's chosen shed dimensions (also stored in the $_SESSION).