Jump to content

Problem displaying backoffice orders


Martino00

Recommended Posts

Recently i upgraded to PrestaShop 1.6.1.23

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

like you can see here below.

orderview.jpg.54bacdbe99bd3d3870ecc5a4315077c8.jpg

 

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

<script>
          $('#tabOrder a').click(function (e) {
            e.preventDefault()
            $(this).tab('show')
          })
        </script>

line 390

<script>
          $('#myTab a').click(function (e) {
            e.preventDefault()
            $(this).tab('show')
          })
        </script>

and line 777

<script>
          $('#tabAddresses a').click(function (e) {
            e.preventDefault()
            $(this).tab('show')
          })
        </script>

 

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()
    {
        //Bootstrap
        $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->addJquery();
        $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_)));

        $this->addJS(array(
            _PS_JS_DIR_.'admin.js?v='._PS_VERSION_,
            _PS_JS_DIR_.'tools.js?v='._PS_VERSION_,
            _PS_JS_DIR_.'jquery/plugins/timepicker/jquery-ui-timepicker-addon.js'
        ));

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()
    {
        parent::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...