kornfr333k Posted January 23, 2015 Share Posted January 23, 2015 Hi, i have a weird problem, since the last update of prestashop, that i just noticed. In my mega menu module i have the option of placing one product to be showed in the right side of the pane. I add the product by typing in a product name in the selection box, and it usually lists products in a drop-downn list, for me to select. (just like in the search box.) But now i get a weird string, containing all my product names, and i cannot select anything. The string starts with " undefined - [{"id":638,"name":"Bicicleta..... " and it goes on just like this, listing all my products in one string. i have attached two screens of my problem, hoping you can help me solve this. it should look like this: I need to mention that today i had a weird problem when all the names of the modules dissappeared from the modules list, and i had to make some modifications to classes/Translate.php with THIS fix from GitHub, and that problem was fixed. i don't know if it's related, but i really need some help. I want to mention that this only happens in the configuration page of that mega menu module. thanks Link to comment Share on other sites More sharing options...
rdgdeg Posted January 27, 2015 Share Posted January 27, 2015 Hello, I've the same prolem... Did you find an issue? Thx. Rdgdeg Link to comment Share on other sites More sharing options...
vicaalvarez Posted May 22, 2015 Share Posted May 22, 2015 Hi, i have a weird problem, since the last update of prestashop, that i just noticed. In my mega menu module i have the option of placing one product to be showed in the right side of the pane. I add the product by typing in a product name in the selection box, and it usually lists products in a drop-downn list, for me to select. (just like in the search box.) But now i get a weird string, containing all my product names, and i cannot select anything. The string starts with " undefined - [{"id":638,"name":"Bicicleta..... " and it goes on just like this, listing all my products in one string. i have attached two screens of my problem, hoping you can help me solve this. 1.PNG 2.png it should look like this: 3.png I need to mention that today i had a weird problem when all the names of the modules dissappeared from the modules list, and i had to make some modifications to classes/Translate.php with THIS fix from GitHub, and that problem was fixed. i don't know if it's related, but i really need some help. I want to mention that this only happens in the configuration page of that mega menu module. thanks How did you fix this? i have the same issue Link to comment Share on other sites More sharing options...
kornfr333k Posted May 22, 2015 Author Share Posted May 22, 2015 For the mega-menu, it was a module related issue, and the module was native to the theme. It seemed like a bug in the js files after upgrading to 1.6 and i had to ask for support from the theme creator since i don't know how to handle js. I don't think the fix he applied is compatible with other mega-menus or themes. For the other problem in the module list, i used the fix in the comment. I still have a few modules that are missing their title but i can use them as is. Link to comment Share on other sites More sharing options...
vicaalvarez Posted May 22, 2015 Share Posted May 22, 2015 (edited) For the mega-menu, it was a module related issue, and the module was native to the theme. It seemed like a bug in the js files after upgrading to 1.6 and i had to ask for support from the theme creator since i don't know how to handle js. I don't think the fix he applied is compatible with other mega-menus or themes. For the other problem in the module list, i used the fix in the comment. I still have a few modules that are missing their title but i can use them as is. thanks for the quick reply, do you have more information? now that you say its js i now where to look. I use warehouse theme which has megamenu and it looks exactly the same, soo maybe it can be the same fix? Maybe can you send me the file that was modifed that way i can check if i can fix mine? thanks by the way Edited May 22, 2015 by vicaalvarez (see edit history) Link to comment Share on other sites More sharing options...
kornfr333k Posted May 22, 2015 Author Share Posted May 22, 2015 thanks for the quick reply, do you have more information? now that you say its js i now where to look. I use warehouse theme which has megamenu and it looks exactly the same, soo maybe it can be the same fix? Maybe can you send me the file that was modifed that way i can check if i can fix mine? thanks by the way If you use the Warehouse theme then it's the same issue. If you haven't already, please make sure you buy this theme. It is very usefull when important updates occur, and also the guy that made it is very helpfull. Modify prestashopinstallation/modules/megamenuiqit/js/admin2.js to this: $(document).ready(function(){ var exids2 = ''; $('#product_autocomplete_inputm').autocomplete('ajax_products_list.php', { minChars: 1, autoFill: true, max:20, matchContains: true, mustMatch:true, dataType: 'json', extraParams: { excludeIds : exids2, format: 'json' }, parse: function(data) { var parsed = []; if (data == null) return true; for (var i = 0; i < data.length; i++) { parsed[parsed.length] = { data: data, value: data.name, result: data.name }; } return parsed; }, formatItem: function(item) { return item.id + ' - ' + item.name ; }, cacheLength:0, }).result(function(event, data, formatted) { if (data == null) return false; var productId = data.id; var productName = data.name; $('#right_product_id_curr').html(productName + '(ID: ' + productId + ')'); $('#right_product_id').val(productId); }); var exids = $('#leftproductsitemsInput').val().replaceAll('PRD', ''); $('#leftproduct_autocomplete_input').autocomplete('ajax_products_list.php', { minChars: 1, autoFill: true, max:20, matchContains: true, mustMatch:true, dataType: 'json', extraParams: { excludeIds : exids2, format: 'json' }, parse: function(data) { var parsed = []; if (data == null) return true; for (var i = 0; i < data.length; i++) { parsed[parsed.length] = { data: data, value: data.name, result: data.name }; } return parsed; }, formatItem: function(item) { return item.id + ' - ' + item.name ; }, cacheLength:0, }).result(function(event, data, formatted) { if (data == null) return false; var productId = data.id; var productName = data.name; val = "PRD"+productId; $("#leftproductsitems").append("<option value=\""+val+"\">"+productId + '-' + productName + "</option>"); $('#leftproduct_autocomplete_input').val(''); serialize_leftproducts(); }); function getLeftProductIds() { if ($('#leftproductsitemsInput').val() === undefined) return ''; var ids = $('#leftproductsitemsInput').val().replaceAll('PRD', ''); return ids; } $("#leftproductsremoveItem").click(remove_leftproducts); $("#leftproductsitems").dblclick(remove_leftproducts); function add_leftproducts() { $("#leftproductsavailableItems option:selected").each(function(i){ var val = $(this).val(); var text = $(this).text(); text = text.replace(/(^\s*)|(\s*$)/gi,""); $("#leftproductsitems").append("<option value=\""+val+"\">"+text+"</option>"); }); serialize_leftproducts(); return false; } function remove_leftproducts() { $("#leftproductsitems option:selected").each(function(i){ $(this).remove(); }); serialize_leftproducts(); return false; } function serialize_leftproducts() { var options = ""; $("#leftproductsitems option").each(function(i){ options += $(this).val()+","; }); $("#leftproductsitemsInput").val(options.substr(0, options.length - 1)); } }); Link to comment Share on other sites More sharing options...
vicaalvarez Posted May 22, 2015 Share Posted May 22, 2015 If you use the Warehouse theme then it's the same issue. If you haven't already, please make sure you buy this theme. It is very usefull when important updates occur, and also the guy that made it is very helpfull. Modify prestashopinstallation/modules/megamenuiqit/js/admin2.js to this: $(document).ready(function(){ var exids2 = ''; $('#product_autocomplete_inputm').autocomplete('ajax_products_list.php', { minChars: 1, autoFill: true, max:20, matchContains: true, mustMatch:true, dataType: 'json', extraParams: { excludeIds : exids2, format: 'json' }, parse: function(data) { var parsed = []; if (data == null) return true; for (var i = 0; i < data.length; i++) { parsed[parsed.length] = { data: data, value: data.name, result: data.name }; } return parsed; }, formatItem: function(item) { return item.id + ' - ' + item.name ; }, cacheLength:0, }).result(function(event, data, formatted) { if (data == null) return false; var productId = data.id; var productName = data.name; $('#right_product_id_curr').html(productName + '(ID: ' + productId + ')'); $('#right_product_id').val(productId); }); var exids = $('#leftproductsitemsInput').val().replaceAll('PRD', ''); $('#leftproduct_autocomplete_input').autocomplete('ajax_products_list.php', { minChars: 1, autoFill: true, max:20, matchContains: true, mustMatch:true, dataType: 'json', extraParams: { excludeIds : exids2, format: 'json' }, parse: function(data) { var parsed = []; if (data == null) return true; for (var i = 0; i < data.length; i++) { parsed[parsed.length] = { data: data, value: data.name, result: data.name }; } return parsed; }, formatItem: function(item) { return item.id + ' - ' + item.name ; }, cacheLength:0, }).result(function(event, data, formatted) { if (data == null) return false; var productId = data.id; var productName = data.name; val = "PRD"+productId; $("#leftproductsitems").append("<option value=\""+val+"\">"+productId + '-' + productName + "</option>"); $('#leftproduct_autocomplete_input').val(''); serialize_leftproducts(); }); function getLeftProductIds() { if ($('#leftproductsitemsInput').val() === undefined) return ''; var ids = $('#leftproductsitemsInput').val().replaceAll('PRD', ''); return ids; } $("#leftproductsremoveItem").click(remove_leftproducts); $("#leftproductsitems").dblclick(remove_leftproducts); function add_leftproducts() { $("#leftproductsavailableItems option:selected").each(function(i){ var val = $(this).val(); var text = $(this).text(); text = text.replace(/(^\s*)|(\s*$)/gi,""); $("#leftproductsitems").append("<option value=\""+val+"\">"+text+"</option>"); }); serialize_leftproducts(); return false; } function remove_leftproducts() { $("#leftproductsitems option:selected").each(function(i){ $(this).remove(); }); serialize_leftproducts(); return false; } function serialize_leftproducts() { var options = ""; $("#leftproductsitems option").each(function(i){ options += $(this).val()+","; }); $("#leftproductsitemsInput").val(options.substr(0, options.length - 1)); } }); Thank you so much!! i really appreciate it! 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