Magento 订单状态与状态

发布于 2024-10-01 17:13:02 字数 1419 浏览 2 评论 0原文

我很高兴弄清楚 Magento 中订单的“状态”与“状态”之间的区别。

我们设置了一个自定义流程来将订单发送给第三方履行,我们还有一些自定义逻辑来检查潜在的欺诈订单并将其标记为由管理员用户手动批准发货以进行履行。

我已在模块配置中添加了“待发货”状态和“可以发货”状态,如下所示:

<global>
    ...
    <sales>
        <order>
            <statuses>
                <pending_shipment translate="label"><label>Pending Shipment</label></pending_shipment>
                <ok_to_ship translate="label"><label>OK To Ship</label></ok_to_ship>
            </statuses>
            <states>
                <processing translate="label">
                    <statuses>
                        <pending_shipment />
                    </statuses>
                </processing>
                <payment_review translate="label">
                    <statuses>
                        <ok_to_ship />
                    </statuses>
                </payment_review>
            </states>
        </order>
    </sales>
    ...
</global>

...并且我使用内置的“可疑欺诈”状态来完成所有这些操作。问题在于,“涉嫌欺诈”状态被分组在“付款审核”状态下,如果订单被标记为“涉嫌欺诈”或“付款审核”,则管理员不允许您选择除此之外的任何其他状态2. 理想情况下,“可以发货”选项可用,但分组在“处理中”的“状态”下。 在这里,我在“ payment_review ”状态下有“ OK To Ship ”,并且它使该选项可用,但是当我下拉订单并检查 canShip() 时 - 它失败了,因为它是“ Payment Review”状态。

因此,如果有人可以帮助我了解状态/状态在 Magento 中的工作方式以及如何最好地配置这种情况,我将不胜感激。

I'm having a fun time figuring out the difference between an order's 'state' versus it's 'status' in Magento.

We have a custom flow set up to send out orders to 3rd party fulfillment and we also have some custom logic to check for potentially fraudulent orders and flag them to be manually approved for shipping by an admin user to go out for fulfillment.

I have added a 'Pending Shipment' status, and an 'OK to Ship' status into my module config like so:

<global>
    ...
    <sales>
        <order>
            <statuses>
                <pending_shipment translate="label"><label>Pending Shipment</label></pending_shipment>
                <ok_to_ship translate="label"><label>OK To Ship</label></ok_to_ship>
            </statuses>
            <states>
                <processing translate="label">
                    <statuses>
                        <pending_shipment />
                    </statuses>
                </processing>
                <payment_review translate="label">
                    <statuses>
                        <ok_to_ship />
                    </statuses>
                </payment_review>
            </states>
        </order>
    </sales>
    ...
</global>

...and I use the built in 'Suspected Fraud' status for all of this. The problem is that the 'Suspected Fraud' status is grouped under the state 'Payment Review', and if an order is marked 'Suspected Fraud' or 'Payment Review', the admin doesn't allow you the choice of any other statuses besides those 2. Ideally the 'OK To Ship' option would be available, but grouped under the 'state' of 'Processing'.
Here, I have 'OK To Ship' under the 'payment_review' state and it made the option available, but then when I pull down an order and check canShip() -- it fails because it's a 'Payment Review' state status.

So if anyone can help me understand how states/statuses are intended to work in Magento and how best to configure this situation, I would appreciate it.

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

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

发布评论

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

评论(2

金橙橙 2024-10-08 17:13:02

只是要指出,由于 Magento 允许从管理界面编辑状态(我相信是 1.5 版本),XML 状态配置已被弃用。现在唯一相关的配置位于 sales_order_status 和 sales_order_status 状态表内。

如果您想添加新的,只需通过 phpmyadmin 编辑表格(您也可以通过安装程序脚本以编程方式进行操作 http://www.techytalk.info/programmatically-add-new-order-state-and-status-in-magento/)

Just to point out that since Magento allowed editing statuses from admin interface (1.5 version I believe), XML statuses configuration has become deprecated. Now the only relevant configuration is inside sales_order_status and sales_order_status state tables.

If you want to add new ones just edit the tables trough phpmyadmin (you can also do it programmaticaly trough installer script http://www.techytalk.info/programmatically-add-new-order-state-and-status-in-magento/)

美胚控场 2024-10-08 17:13:02

我的理解是,对于给定的状态(由正常订单流确定,并且实际上并不可变),您可以自由地更改订单的状态(这是一个标签)。根据您想要完成的任务,您可以尝试将 克隆到您希望它们处于的其他状态吗?它们似乎并不具有排他性。

谢谢,

My understanding is that for a given state (which are determined by the normal order flow, and aren't really mutable), you have free reign to change the status for the order (which is a label). Depending on what you want to accomplish, could you try cloning <okay_to_ship /> into the other state you want them in? They don't appear to be exclusive.

Thanks,
Joe

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