Regorro Posted October 2, 2018 Share Posted October 2, 2018 (edited) Hi, I have just installed fresh version of PS 1.7.4.2, but I can not remove those default products that prestashop puts on start. When I am in products list page, and press 'remove' either individually or all together - nothing happens. In my JS console I see an error apearing on this page: TypeError: t.ui is undefined jquery.ui.sortable.min.js:4:148 TypeError: $(...).modal is not a function catalog:3465:9 TypeError: $(...).modal is not a function catalog.js:352:7 How is this possible? I have a fresh installation, (just added my module and few things in theme.yml) and the store already breaks? This sortable is not my script, I beliefe prestashop uses this plugin to display the orders in list. But then why is it already broken? My module doesn't use any sortable - this has to be store plugin that breaks :/ Also now I see on 'installed modules' page another JS error (and it's also prestashop's script): TypeError: $(...).tooltip is not a function default.js:7:3 Edited October 2, 2018 by grzegorz123456 (see edit history) Link to comment Share on other sites More sharing options...
Regorro Posted October 2, 2018 Author Share Posted October 2, 2018 (edited) Ok, I have just found a solution. So for everyone else having this problem: Apparently prestashop 1.7.4 is very sensitive with the jQuery. In past I added jQuery in my module, so I am sure my script is loaded after, this way: public function hookActionAdminControllerSetMedia($params) { $this->context->controller->addJquery(); $this->context->controller->addJS($this->_path .'assets/css_js/admin.js'); So removing this $this->context->controller->addJquery() fixes the problem. No error in console, can remove products. Jquery is included in Prestashop core.js so basically no need to add it separately again in your module. Edited October 2, 2018 by grzegorz123456 (see edit history) 1 Link to comment Share on other sites More sharing options...
jstillings1 Posted October 13, 2018 Share Posted October 13, 2018 If you delete the categories it will ask you if you want to remove the products. Link to comment Share on other sites More sharing options...
donaldante Posted February 19, 2019 Share Posted February 19, 2019 On 10/2/2018 at 6:11 PM, Regorro said: In my JS console I see an error apearing on this page: TypeError: t.ui is undefined jquery.ui.sortable.min.js:4:148 TypeError: $(...).modal is not a function catalog:3465:9 TypeError: $(...).modal is not a function catalog.js:352:7 The $(…).modal is not a function is usually caused because scripts are loaded in the wrong order . The browser will execute the scripts in the order it finds them. If in a script you attempt to access an element that hasn't been reached yet then you will get an error. Make sure that you don't have a script above one that it requires. 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