Martino00 Posted January 10, 2019 Share Posted January 10, 2019 (edited) 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. 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 January 10, 2019 by Martino00 (see edit history) Link to comment Share on other sites More sharing options...
Vreo Posted July 20, 2020 Share Posted July 20, 2020 Hey Martino00, I have the same problem, did you manage to solve it?? I would appreciate any help from you or anyone in the forum! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now