Jump to content

Prestashop 1.7.6 Issue with Order.php


Alien(PL)

Recommended Posts

When store is in Debug Mode ON i get an error when try to access Order history form user panel.

1971668851_Zrzutekranu2020-12-15o20_32_53.thumb.png.58ffc3fdfb610c84692c1faef79995a8.png

 

Code in the Oder.php is:

        foreach ($res as $key => $val) {
            $res[$key]['order_state'] = $indexedOrderStates[$val['id_order_state']]['name'];
            $res[$key]['invoice'] = $indexedOrderStates[$val['id_order_state']]['invoice'];
            $res[$key]['order_state_color'] = $indexedOrderStates[$val['id_order_state']]['color'];
        }

When i turn off the debug mode i can list orders but when i click "Order details" i get the page with no data about the order and no errors.

 

HistoryController.php line 72

        $customer_orders = Order::getCustomerOrders($this->context->customer->id);

HistoryController.php line 55

$orders = $this->getTemplateVarOrders();

in Controller.php line 292

			if ($this->viewAccess()) {
292:            $this->initContent();
            } else {
                $this->errors[] = $this->trans('Access denied.', array(), 'Admin.Notifications.Error');
            }

in Dispatcher.php line 515

	if (isset($params_hook_action_dispatcher)) {
                Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
            }

 

Edited by Alien(PL) (see edit history)
Link to comment
Share on other sites

In debug mode you get an error message for any notice that may be there in the code, so this may not be very much related, a notice is not even a warning.

If you get a blank page when viewing orders I would suggest to check:

1. error logs on the server

2. any modules that may be attached to order - related hooks.

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...