jaimeZesis Posted August 11, 2017 Share Posted August 11, 2017 (edited) When I try to use the combination generator with any product, after I select any combination (1 or more, it doesn't matter) and click "Add" nothing happend. No message error, no creation of the combinations... If I use the navigator console I got the message: "ReferenceError: add_attr_multiple is not defined". I'm using Prestashop 1.6.1.11 Anybody knows how to solve this? Edited August 11, 2017 by jaimeZesis (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted August 11, 2017 Share Posted August 11, 2017 Is the attributes.js file being included in the page?It's a function supposed to be defined there Link to comment Share on other sites More sharing options...
jaimeZesis Posted August 21, 2017 Author Share Posted August 21, 2017 I think so. I compare the code on github with the code I have and if I have understand the lines aftr the big comment are the important one, and the code is exactly the same. If it is not, tell me what part of code I am suppose to find. Link to comment Share on other sites More sharing options...
NemoPS Posted August 21, 2017 Share Posted August 21, 2017 Can you check if it's in the list of files in the debug console?Under application, click top, then scripts Link to comment Share on other sites More sharing options...
jaimeZesis Posted August 21, 2017 Author Share Posted August 21, 2017 I have follow this, but I don't see nothing similar to application, click top, then scripts. What I can see on the screen that pop up is that the variable $attribute_js has the values that it should. Link to comment Share on other sites More sharing options...
NemoPS Posted August 21, 2017 Share Posted August 21, 2017 I mean chrome's console Link to comment Share on other sites More sharing options...
jaimeZesis Posted August 22, 2017 Author Share Posted August 22, 2017 No, it doesn't appear Link to comment Share on other sites More sharing options...
jaimeZesis Posted August 22, 2017 Author Share Posted August 22, 2017 (edited) I have find where the error is. Using the depurator of Mozilla console and comparing the code with other prestashop I realise that I'm missing one line: <script type="text/javascript" src="/js/admin/attributes.js"></script> How can I add that line? Edited August 22, 2017 by jaimeZesis (see edit history) Link to comment Share on other sites More sharing options...
Dhvani Posted August 22, 2017 Share Posted August 22, 2017 You can try with: Add js and/or css files in /prestashop/themes/theme-name/js (or css). Edit /prestashop/classes/controller/FrontController.php. Add below code: <?php class FrontController extends FrontControllerCore { public function setMedia() { parent::setMedia(); // CSS files Tools::addJS(_THEME_JS_DIR_.'myfile.js'); Tools::addCSS(_THEME_CSS_DIR_.'myfile.css', 'all'); } } Link to comment Share on other sites More sharing options...
jaimeZesis Posted August 23, 2017 Author Share Posted August 23, 2017 (edited) Dhvani my problem is with the back office, but putting what you say on other route (/prestashop/adminFolder/themes/default/js/ )and editing /classes/controller/adminControler.php makes the "Add" button work, but now, when I click on "Generate this combinations" I get "Property Combination->minimal_quantity is empty" error. What I think is failing is that when I go to the combinations generator the attributes.js file (which is the one who makes all work) is not loaded. EDIT: I add this line: $this->addJS(__PS_BASE_URI__.'js/admin/attributes.js'); on the /classes/controller/adminControler.php file, and now the attributes.js file is loaded on the page, but I keep having the "Property Combination->minimal_quantity is empty" error. Edited August 23, 2017 by jaimeZesis (see edit history) Link to comment Share on other sites More sharing options...
Dhvani Posted August 24, 2017 Share Posted August 24, 2017 Ok can you update Combination.php and changed all quantities to float. Link to comment Share on other sites More sharing options...
jaimeZesis Posted August 24, 2017 Author Share Posted August 24, 2017 I don't think so, because the products that I sell can't be one and a half. It has to be units. Link to comment Share on other sites More sharing options...
Dhvani Posted August 25, 2017 Share Posted August 25, 2017 Yes it can not be one and half but can be 1.0. There is one more option you should try, You can replace your combination.php file with the fresh PrestaShop version. Link to comment Share on other sites More sharing options...
jaimeZesis Posted August 25, 2017 Author Share Posted August 25, 2017 I have changed the three TYPE_INT that I found to TYPE_FLOAT, but the error persists. Link to comment Share on other sites More sharing options...
Dhvani Posted August 25, 2017 Share Posted August 25, 2017 Ok you should change combination.php file with Prestashop fresh version. Link to comment Share on other sites More sharing options...
jaimeZesis Posted August 25, 2017 Author Share Posted August 25, 2017 I have deleted my file, and copy all the code ofthe github on a new file with the same name but nothing happen Link to comment Share on other sites More sharing options...
Dhvani Posted August 26, 2017 Share Posted August 26, 2017 (edited) No don't take it from github but try to replace with original Prestashop files means Prestashop 1.6.1.11 'combination.php file' which you are using. Edited August 26, 2017 by Dhvani (see edit history) Link to comment Share on other sites More sharing options...
jaimeZesis Posted August 28, 2017 Author Share Posted August 28, 2017 (edited) The error keeps showing Edited August 28, 2017 by jaimeZesis (see edit history) Link to comment Share on other sites More sharing options...
jaimeZesis Posted August 30, 2017 Author Share Posted August 30, 2017 Any idea of what is happening? Link to comment Share on other sites More sharing options...
jaimeZesis Posted September 4, 2017 Author Share Posted September 4, 2017 When I try to generate a combination I get: Property Combination->minimal_quantity is empty any idea why?? Link to comment Share on other sites More sharing options...
jaimeZesis Posted September 4, 2017 Author Share Posted September 4, 2017 Solved, the problem was that I had the file AdminAttributeGeneratorController.php override, and there I had 'minimal_quantity' => pSQL($_POST['minimum-quantity']) ' When I comment that line it works perfectly. 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