简体   繁体   English

magento中成功订单的产品库存状态更新

[英]Product stock status update on success order in magento

I am using solr search in our project. 我在我们的项目中使用solr搜索。 I need to update the product stock status(In Stock/Out of Stock) in solr document on success order. 我需要在成功订单的solr文档中更新产品库存状态(有库存/无库存)。 I need to know the place/function where the product stock status is getting updates on success order. 我需要知道产品库存状态获取成功订单更新的位置/功能。 ie If the product goes out of stock on success order, it should be update the product stock order as out of stock . 即,如果成功订单中的产品缺货,则应将产品库存订单更新out of stock Manual status changing from back-end is affecting in solr document. 从后端手动更改状态会影响Solr文档。 But on success order I need to update the status in solr document. 但是根据成功命令,我需要更新solr文档中的状态。 Is there any observer/event for this? 有观察者/事件吗? Please help me out this. 请帮我解决这个问题。

You have seven event in the sales_order_model but if I am not wrong, the "save" event is the one that you need for such observer : sales_order_save_before or sales_order_save_after . 您在sales_order_model中有七个事件,但是如果我没有记错的话,“保存”事件就是您需要此类观察者使用的事件: sales_order_save_beforesales_order_save_after With it you can check the status of the order and act accordingly. 使用它,您可以检查订单状态并采取相应措施。

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

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