可以在默认“订单”视图中隐藏发货订单吗?

时间:2019-10-25 11:54:55

标签: php opencart opencart-3

我正在尝试确定在转到订单时是否可以从默认视图中隐藏标记为已发货的订单。这类似于“缺失订单”不在默认视图中,而是需要从下拉列表中单击的方式。

我认为列表中没有历史订单的必要性主要是因为我发现自己不得不太频繁地滚动才能获取一些尚未发货的订单。

2 个答案:

答案 0 :(得分:0)

是的,您需要在sql查询中添加一些用于列出订单的信息。这是一个可以隐藏订单状态ID 3(应该出厂)的模块,除非它是从下拉菜单中选择的:

<id><![CDATA[Not Display Shipped order status.]]></id>
<version><![CDATA[1.0.0]]></version>
<vqmver><![CDATA[2.4.1]]></vqmver>
<author><![CDATA[Mujahid Bhoraniya - bhoraniyamujahid@gmail.com]]></author>



<!-- @GLOBAL CONTROLLER -->
<file name="admin/model/sale/order.php">

    <operation info="make query choose all orders except missing and shipped" error="log">
        <search position="replace"><![CDATA[
            $sql .= " WHERE o.order_status_id > '0'";
        ]]></search>
        <add><![CDATA[
        $sql .= " WHERE o.order_status_id > '0' && o.order_status_id != '3'";
        ]]></add>
    </operation>

    <operation info="make query choose all orders except missing and shipped" error="log">
        <search position="replace" index="1"><![CDATA[
            $sql .= " WHERE order_status_id > '0'";
        ]]></search>
        <add><![CDATA[
        $sql .= " WHERE order_status_id > '0' && order_status_id != '3'";
        ]]></add>
    </operation>

</file>

答案 1 :(得分:0)

OCMOD-解决方案

您可以复制以下代码并创建新的install.xml文件

<name><![CDATA[Admin Not Display Shipped order status in order list]]></name>
<code><![CDATA[Admin Not Display Shipped order status in order list]]></code>
<version><![CDATA[3.x]]></version>
<author><![CDATA[Dhaupin - CreadevDotOrg]]></author>



<!-- @GLOBAL CONTROLLER -->
<file path="admin/model/sale/order.php">

    <operation info="make query choose all orders except missing and shipped" error="log">
        <search><![CDATA[
            $sql .= " WHERE o.order_status_id > '0'";
        ]]></search>
        <add position="replace"><![CDATA[
        $sql .= " WHERE o.order_status_id > '0' && o.order_status_id != '3'";
        ]]></add>
    </operation>

    <operation info="make query choose all orders except missing and shipped" error="log">
        <search><![CDATA[
            $sql .= " WHERE order_status_id > '0'";
        ]]></search>
        <add  position="replace" index="1"><![CDATA[
        $sql .= " WHERE order_status_id > '0' && order_status_id != '3'";
        ]]></add>
    </operation>

</file>

之后,您可以将zip文件安装为install.xml文件。它的名字为Shipped.ocmod.zip