Search code examples
phpopencartopencart-3

Possible to Hide Shipped orders in default Order view?


I'm trying to figure out if it's possible to hide the orders marked as shipped from the default view when I go to my orders. This would be similar to how "missing orders" isn't in the default view but needs to be clicked on from the dropdown list.

I don't see the need to have historical orders in the list mostly because I find myself having to scroll too often to get to some orders that haven't been shipped yet.


Solution

  • Yes you need to add a bit to the sql query for listing orders. Here is a mod that hides order status ID 3 (which should be shipped) unless its chosen from the dropdown:

    <id><![CDATA[Not Display Shipped order status.]]></id>
    <version><![CDATA[1.0.0]]></version>
    <vqmver><![CDATA[2.4.1]]></vqmver>
    <author><![CDATA[Mujahid Bhoraniya - [email protected]]]></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>