Jump to content

Problem displaying backoffice orders


Recommended Posts

Recently i upgraded to PrestaShop

In the backoffice i have a problem. When i click an order, the view is wrong

like you can see here below.



By using the chrome devtools i get three times an error

Uncaught ReferenceError: $ is not defined
    at index.php?controller=AdminOrders&id_order=  ...


The problem seems to be in the view.tpl file in folder admin/themes/default/template/controllers/orders/helpers/view

line 267

          $('#tabOrder a').click(function (e) {

line 390

          $('#myTab a').click(function (e) {

and line 777

          $('#tabAddresses a').click(function (e) {


I understand that it's a JQuery problem.


in my js/jquery folder there is jquery-1.11.0.min.js

in my defines.inc.php i can see

if (!defined('_PS_JQUERY_VERSION_')) {
    define('_PS_JQUERY_VERSION_', '1.11.0');

and in my AdminController.php i have

 public function setMedia()
        $this->addCSS(__PS_BASE_URI__.$this->admin_webpath.'/themes/'.$this->bo_theme.'/css/'.$this->bo_css, 'all', 0);
        $this->addCSS(__PS_BASE_URI__.$this->admin_webpath.'/themes/'.$this->bo_theme.'/css/overrides.css', 'all', PHP_INT_MAX);

        $this->addjQueryPlugin(array('scrollTo', 'alerts', 'chosen', 'autosize', 'fancybox' ));
        $this->addjQueryPlugin('growl', null, false);
        $this->addJqueryUI(array('ui.slider', 'ui.datepicker'));

        Media::addJsDef(array('host_mode' => (defined('_PS_HOST_MODE_') && _PS_HOST_MODE_)));


so i think that the correct Jquery is loaded and that the loading order is correct also.


I have also a AdminordersController.php in override.
There i see

class AdminOrdersController extends AdminOrdersControllerCore
    * module: pproperties
    * date: 2018-12-21 13:56:17
    * version: 2.35
    public function setMedia()
        $js_files = array('js/admin/orders.js');
        PSM::amendJS($this->context->controller->js_files, $js_files);


Anyone a clue how to display my orders again?



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

  • 1 year later...

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