Jump to content

Hide Order State for Customers


Recommended Posts

  • 3 weeks later...
  • 4 weeks later...

The "hide order state for customers" means hide the status, not the order. The customer will see the last visible order status for that order.

It doesn´t works in 1.2.4 version but is solved in SVN. See it at the bug tracker "http://www.prestashop.com/bug_tracker/view/2992/". This change the function getCustomerOrders in class/order.php

If you want to hide the orders (wich status is hidden) in the history customer page. you can do this.

In history.php where:

if ($orders = Order::getCustomerOrders(intval($cookie->id_customer)))
   foreach ($orders AS &$order)
   {
       $myOrder = new Order(intval($order['id_order']));                                                     
       if (Validate::isLoadedObject($myOrder))
           $order['virtual'] = $myOrder->isVirtual(false);
   }



Write

if ($orders = Order::getCustomerOrders(intval($cookie->id_customer)))
   foreach ($orders AS &$order)
   {
       $myOrder = new Order(intval($order['id_order']));
       $myOrderState = new OrderState(intval($myOrder->getCurrentState()));
       if ($myOrderState->hidden){
           $delKey=array_search($order,$orders);
           unset($orders[$delKey]);
       }

       if (Validate::isLoadedObject($myOrder))
           $order['virtual'] = $myOrder->isVirtual(false);
   }



I think it will work.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...