Magento - 如何设置商品的每日库存

发布于 2024-12-02 16:20:25 字数 308 浏览 2 评论 0原文

第一篇关于堆栈溢出的文章!开始吧……

好吧,我的服务器上安装了 Magento 社区版 v1.5.1.0,并且准备好了一个产品。产品具有日期属性,即客户希望产品交付的日期。该产品是我在客户订购时制作的商品。这种产品的数量有限,我一天只能生产这么多。所以我的问题是,如何跟踪已设置在特定日期交货的总订单数,并在达到上限时禁止在前端选择该日期。

我尝试过寻找插件,但还没有找到适合这种情况的东西。任何建议/指示都会很棒。

如果需要的话,我很高兴开始研究内部代码。只是想确保在投入之前我没有错过一个简单的选择!

预先感谢

贾斯汀

First post on stack overflow! Here we go…

OK, so I have Magento community edition v1.5.1.0 setup on my server and have a single product all ready to go. The product has a date attribute which is the date the customer would like the product delivered. The product is an item that I make when a customer orders it. There are only so many of this product that I can physically make a day. So my question is, how do I keep track of the total orders that have been set for delivery on a certain date and disable that date from being selected on the front end when the cap has been met.

I've tried looking for plugins but haven't found anything that suits this situation yet. Any advice/pointers would be great.

I'm quite happy to start prodding at the internal code if need be. Just wanted to make sure I wasn't missing an easy option before diving in!

Thanks in advance

Justyn

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

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

发布评论

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

评论(1

暗恋未遂 2024-12-09 16:20:25

是的,这是一个非常不寻常的模块,我可以理解为什么还没有预制的插件。

首先 - 不要刺激内部代码!您必须通过编写自定义模块来扩展平台,否则您的应用程序将无法适应未来的需求。

这是一个快速的攻击计划,向您展示一些 Magento 技术来实现您的目标。

  1. 向您希望应用此限制的产品添加属性“delivery_date_capacity”

  2. 创建自定义模块,用于侦听订单并存储产品和要交付的日期的记录,以及每个交付日的阈值订单,当产品在(“delivery_date_capacity”中具有识别属性时会触发该模块)。

根据您所需的用户体验(当满足每日阈值时),当客户单击“添加到购物车”时,模块可能会重定向并显示一条消息,说明此交货日期不可用,并建议之前和之后接近的交货日期后。

  1. 您可能希望添加反向功能,以便在订单取消时自动增加容量。添加一个观察者,该观察者在管理员中加载产品时触发,该观察者在取消订单时检查是否应通过引用“delivery_date_capacity”属性再次检查产品可用性。

  2. 您还可以加载一个显示可用日期的日历,以降低用户的点击率,特别是当您预计建议的日期对客户来说不容易选择时。

Yes this is quite an unusual module and I can understand why there is no pre made plugin yet.

First of all - don't prod the internal code!!! You must extend the platform by writing a custom module, otherwise your application will not be future proof.

Here is a quick plan of attack to show you some Magento techniques for achieving your aim.

  1. Add an attribute to the products which you wish to have this constraint apply to, "delivery_date_capacity"

  2. Create a custom module which listens for orders and stores a record of product and date to be delivered, as well as the threshold orders per delivery day, which is fired when product has the identifying attribute in( "delivery_date_capacity" ).

Depending on the user experience you require, (when the daily threshold is met), when customer clicks "Add to Cart" the module could redirect with a message saying this delivery date is not available, and suggest ones which are close to it before and after.

  1. You may wish to add reverse functionality to automatically add capacity if orders are cancelled. Add an observer which is fired when a product is loaded in the admin which checks if the product availability should be checked again by referencing "delivery_date_capacity" attribute, when an order is cancelled.

  2. You could also load a calendar which show the available dates to reduce the click rate of user, especially if you anticipate suggested dates not being easy for a customer to choose.

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