petergr Posted February 15, 2014 Share Posted February 15, 2014 Hi, I have a problem about my PrestaShop. I'm using 1.5.6.0. When I create a product, I also create some combinations (size and color). Lets say that I have the following combinations: Color: Black Sizes: 36 - 37 - 38 Color: Red Sizes: 36 - 37 So, size 38 is only available to black color. But when I go to frontend to check the product, when I click the red color, the size 38 is there (it shouldn't). When a color is selected, I want to display only the available sizes. What can I do to fix this? I have already disabled the option to "not to show the unavailable attributes" from the preferences tab. Link to comment Share on other sites More sharing options...
mickeyboy1 Posted February 15, 2014 Share Posted February 15, 2014 I too would like to know the answer to this ??? Link to comment Share on other sites More sharing options...
El Patron Posted February 15, 2014 Share Posted February 15, 2014 you can tell prestashop not to display unavailable attributes on product page, hope this is what you were looking for. http://screencast.com/t/XfpbGLvvvQt 1 Link to comment Share on other sites More sharing options...
petergr Posted February 16, 2014 Author Share Posted February 16, 2014 El Patron, if you read my first post you will see that I've already done this. Any other solutions? Link to comment Share on other sites More sharing options...
tomerg3 Posted February 17, 2014 Share Posted February 17, 2014 Prestashop can only do that with 1 attribute group. If you use more than 1 group, you should check out the following module http://www.prestashop.com/forums/topic/38061-module-attribute-wizard-customize-prestshop-attributes-control-the-group-and-item-order-add-group-images-descriptions-and-more/ A demo of it is available at http://144aw.presto-changeo.com/product.php?id_product=1 Link to comment Share on other sites More sharing options...
Ether Création Posted February 21, 2014 Share Posted February 21, 2014 Hello,I think this module could answer your needs. http://addons.prestashop.com/fr/fonctionnalites-front-office-modules-prestashop/12352-affichage-des-declinaisons-avancee.htmlBest regards Arthur Link to comment Share on other sites More sharing options...
redwert Posted September 3, 2015 Share Posted September 3, 2015 This can help you https://github.com/redwert/prestashop-color-and-size 2 Link to comment Share on other sites More sharing options...
jeff8899 Posted February 4, 2018 Share Posted February 4, 2018 On 9/3/2015 at 7:40 PM, redwert said: This can help you https://github.com/redwert/prestashop-color-and-size hi Redwert i tried the module but nothing is changed! how to get it work? Link to comment Share on other sites More sharing options...
selectshop.at Posted February 4, 2018 Share Posted February 4, 2018 3 minutes ago, jeff8899 said: hi Redwert i tried the module but nothing is changed! how to get it work? And you are using the correct Prestashop version for this to work ? This Topic is 4 years old now and for PS 1.5. The latest commit of github was in year 2015 - Quote Latest commit 8959d37 on 3 Sep 2015 redwert Update HideUnavailableSizes.js Link to comment Share on other sites More sharing options...
jeff8899 Posted February 4, 2018 Share Posted February 4, 2018 thanks for your reply! i am using PS 1.6. any updated module for PS1.6? Link to comment Share on other sites More sharing options...
selectshop.at Posted February 4, 2018 Share Posted February 4, 2018 The script on github is not a module, but a script change. This was hot runner question also for PS 1.6. Did you tried forum search ? Solution: You can disable this on your back-office on TAB: Preferences -> Products. Into the Product page section, the option is: Display unavailable product attributes on the product page = NO And in the Products stock section: Allow ordering of out-of-stock products = NO Ensure that the products have the option: When out of stock -> Default (in the Quantities section) to get the Default configuration (in this case, Deny orders). With this configuration, the unavailable stock combinations will not appear in the Product page. And this is the same answer already given here in post #3 - https://www.prestashop.com/forums/topic/308751-hide-unavailable-combinations/?do=findComment&comment=1563026 After you changed the configuration, delete smarty cache and browser cache, for to don't see a cached site. There are also paid addons doing that, if you are allowing customers to buy products that are out of stock: https://addons.prestashop.com/en/combinaisons-customization/17711-enable-disable-a-combination-import-csv.html https://addons.prestashop.com/en/additional-information-product-tab/22127-disable-out-of-stock-unavailable-product-combinations.html Link to comment Share on other sites More sharing options...
jeff8899 Posted February 5, 2018 Share Posted February 5, 2018 i followed the exact instruction but still not work. the non-exist attributes are still showing and display the message: This combination does not exist for this product. Please select another combination. i m now a bit confused. the function of the setting Display unavailable product attributes on the product page = NO is for out of stock attributes only? or for those non-exist attributes?? my meaning of non-exist attributes is following. Size M, Color Pink Size M, Color Blue Size L, Color Blue. there is no Size L, color Pink (never set this combination), but it still shows as an option with message This combination does not exist for this product. Please select another combination. I am looking for a solution to complete hide all attribute combination which i have never set (just like the Size L, Color Pink). Hope you understand what i mean. Link to comment Share on other sites More sharing options...
vinefreshtees Posted March 14, 2018 Share Posted March 14, 2018 I have the same problem as well. I sell clothing and have several colors that aren't offered in a 4XL so I left off the combination for the 4XL colors that aren't available. On my product page when 4XL is selected it shows all colors, not just the ones available for 4XL. You have to click each color to find out which ones are available. I get the This combination does not exist for this product. Please select another combination message as well. I have Display unavailable product attributes on the product page already set to no. Was a solution to this ever found? Link to comment Share on other sites More sharing options...
tomerg3 Posted March 14, 2018 Share Posted March 14, 2018 vinefreshtees: Our Attribute Wizard module has this capability, as far as we know, there is no other fix for this, as it requires complex calculations. Link to comment Share on other sites More sharing options...
vinefreshtees Posted March 15, 2018 Share Posted March 15, 2018 Thank you!! I have to look in to this module. I purchased your mass combination editor a few years back. It is hands down the best module I have ever purchased. I love that I can link a specific color shirt to a specific swatch color. It has made my job so much easier!! Link to comment Share on other sites More sharing options...
tomerg3 Posted March 15, 2018 Share Posted March 15, 2018 vinefreshtees: Glad to hear Link to comment Share on other sites More sharing options...
vinefreshtees Posted March 21, 2018 Share Posted March 21, 2018 On 3/14/2018 at 1:03 PM, tomerg3 said: vinefreshtees: Our Attribute Wizard module has this capability, as far as we know, there is no other fix for this, as it requires complex calculations. I see you have a couple of different attribute wizards. Will all of them hide unavailable combinations or does just one specific one do that? Link to comment Share on other sites More sharing options...
tomerg3 Posted March 21, 2018 Share Posted March 21, 2018 5 hours ago, vinefreshtees said: I see you have a couple of different attribute wizards. Will all of them hide unavailable combinations or does just one specific one do that? We have 2 attribute wizards, both available for PS 1.6 and lower, or PS 1.7 and higher, and both support hiding of unavailable or out of stock combinations. Attribute Wizard does not change the way combinations are handled, and offers product page flexibility. Attribute Wizard Pro changes the way combinations are handled, which allows for a virtually unlimited number of attribute per product, with greater flexibility and functionality. Link to comment Share on other sites More sharing options...
Mariano Posted June 1, 2018 Share Posted June 1, 2018 (edited) Hi everybody, I was able to solve this feature for my needs. I tested on PS 1.6.1.17 Sorry for my english. I took the base from https://github.com/redwert/prestashop-color-and-size For a shoes sell site, I needed to manage several size attributes. (men size, women size, child size, mix size) I used 1 combo select and colors attribute for every product (more than one combo select is not needed for my purpose). Example: for a product I have Red -> 7, 8, 9, 10 Blue -> 8,9,10 White -> 7,9 When I click on Red, the combo is setting with size 7,8,9,10. Click on Blue, the combo only shows 8,9,10, etc. The unavailable combinations doesn't shows. The difference with https://github.com/redwert/prestashop-color-and-size is that the "ID Size attribute" may vary (men size, women size, child size, mix size). For clothes Size possibly one "ID Size attribute" is enough. Thats why I assert dinamically the prefix "group_" for the select combo. The code for HideUnavailableSizesnew.js is var colorAttributteID='3'; // Set your color attribute ID - in my case is 3 $(document).ready(function(){ var sizeList={}; // Get all the sizes availables from the unique combo select on screen $('select[name^="group_"] option').each(function(){ if (sizeList[this.text]==undefined){ sizeList[this.text]=$(this).val(); // get size list option values } }); var currentColor; currentColor=combination.attributes_values[colorAttributteID]; // get current color renewSizeList(sizeList, currentColor); // Catch the click on color attribute $('[name=group_'+ colorAttributteID +']').parent().children('ul').children('li').children('a').click(function(){ currentColor=$(this).attr('name'); renewSizeList(sizeList, currentColor); }); }); //Clear the combo select and set the combo with the corresponding sizes values for the choosen color function renewSizeList(sizeList, currentColor){ $('select[name^="group_"]').empty(); //clear list var theSize; var sizeAttrID; sizeAttrID = $('select[name^="group_"]').attr( 'id' ).substr(6); //Get the id of the for(var key in combinationsFromController) { if (combinationsFromController[key].attributes_values[colorAttributteID]==currentColor){ //if this combination with current color theSize=combinationsFromController[key].attributes_values[sizeAttrID]; $('select[name^="group_"]').append('<option value="'+sizeList[theSize]+ '" title="'+theSize+ '">' +theSize+'</option>'); //build the select again } } // Sort the combo list $(function() { // choose target dropdown var select = $('select[name^="group_"]'); select.html(select.find('option').sort(function(x, y) { // to change to descending order switch "<" for ">" return $(x).text() > $(y).text() ? 1 : -1; })); //Set the first option selected $('select[name^="group_"] option:first').attr('selected','selected'); // Set the current value on screen - in PS above the combo select there is a <span> tag $('select[name^="group_"]').prev().text($('select[name^="group_"] option:first').text()); }); }; I hope this works!! regards Edited June 1, 2018 by Mariano (see edit history) Link to comment Share on other sites More sharing options...
Eduardo Cuomo Posted June 9, 2018 Share Posted June 9, 2018 On 1/6/2018 at 10:03 AM, Mariano said: Hi everybody, I was able to solve this feature for my needs. I tested on PS 1.6.1.17 Sorry for my english. I took the base from https://github.com/redwert/prestashop-color-and-size For a shoes sell site, I needed to manage several size attributes. (men size, women size, child size, mix size) I used 1 combo select and colors attribute for every product (more than one combo select is not needed for my purpose). Example: for a product I have Red -> 7, 8, 9, 10 Blue -> 8,9,10 White -> 7,9 When I click on Red, the combo is setting with size 7,8,9,10. Click on Blue, the combo only shows 8,9,10, etc. The unavailable combinations doesn't shows. The difference with https://github.com/redwert/prestashop-color-and-size is that the "ID Size attribute" may vary (men size, women size, child size, mix size). For clothes Size possibly one "ID Size attribute" is enough. Thats why I assert dinamically the prefix "group_" for the select combo. The code for HideUnavailableSizesnew.js is var colorAttributteID='3'; // Set your color attribute ID - in my case is 3 $(document).ready(function(){ var sizeList={}; // Get all the sizes availables from the unique combo select on screen $('select[name^="group_"] option').each(function(){ if (sizeList[this.text]==undefined){ sizeList[this.text]=$(this).val(); // get size list option values } }); var currentColor; currentColor=combination.attributes_values[colorAttributteID]; // get current color renewSizeList(sizeList, currentColor); // Catch the click on color attribute $('[name=group_'+ colorAttributteID +']').parent().children('ul').children('li').children('a').click(function(){ currentColor=$(this).attr('name'); renewSizeList(sizeList, currentColor); }); }); //Clear the combo select and set the combo with the corresponding sizes values for the choosen color function renewSizeList(sizeList, currentColor){ $('select[name^="group_"]').empty(); //clear list var theSize; var sizeAttrID; sizeAttrID = $('select[name^="group_"]').attr( 'id' ).substr(6); //Get the id of the for(var key in combinationsFromController) { if (combinationsFromController[key].attributes_values[colorAttributteID]==currentColor){ //if this combination with current color theSize=combinationsFromController[key].attributes_values[sizeAttrID]; $('select[name^="group_"]').append('<option value="'+sizeList[theSize]+ '" title="'+theSize+ '">' +theSize+'</option>'); //build the select again } } // Sort the combo list $(function() { // choose target dropdown var select = $('select[name^="group_"]'); select.html(select.find('option').sort(function(x, y) { // to change to descending order switch "<" for ">" return $(x).text() > $(y).text() ? 1 : -1; })); //Set the first option selected $('select[name^="group_"] option:first').attr('selected','selected'); // Set the current value on screen - in PS above the combo select there is a <span> tag $('select[name^="group_"]').prev().text($('select[name^="group_"] option:first').text()); }); }; I hope this works!! regards Excellent! Thank you!!! Link to comment Share on other sites More sharing options...
nadie Posted June 9, 2018 Share Posted June 9, 2018 (edited) Free module of the user -> https://www.prestashop.com/forums/profile/296558-w3bsolutions/ Attachment module hideunavailablecombinations.zip Is for Prestashop 1.6 Hide Nonexistent combinations PS 1.6 This module hides non-existent combinations of the product page in PS 1.6, they are not used to choose them. This avoids the message "this combination does not exist, please choose another one". * It only works if all the attributes are shown as drop-down Sorry for my English Edited June 9, 2018 by nadie update message (see edit history) 1 Link to comment Share on other sites More sharing options...
ANGELO Vintage Posted June 11, 2018 Share Posted June 11, 2018 On 1/6/2018 at 3:03 PM, Mariano said: Hi everybody, I was able to solve this feature for my needs. I tested on PS 1.6.1.17 Sorry for my english. I took the base from https://github.com/redwert/prestashop-color-and-size For a shoes sell site, I needed to manage several size attributes. (men size, women size, child size, mix size) I used 1 combo select and colors attribute for every product (more than one combo select is not needed for my purpose). Example: for a product I have Red -> 7, 8, 9, 10 Blue -> 8,9,10 White -> 7,9 When I click on Red, the combo is setting with size 7,8,9,10. Click on Blue, the combo only shows 8,9,10, etc. The unavailable combinations doesn't shows. The difference with https://github.com/redwert/prestashop-color-and-size is that the "ID Size attribute" may vary (men size, women size, child size, mix size). For clothes Size possibly one "ID Size attribute" is enough. Thats why I assert dinamically the prefix "group_" for the select combo. The code for HideUnavailableSizesnew.js is var colorAttributteID='3'; // Set your color attribute ID - in my case is 3 $(document).ready(function(){ var sizeList={}; // Get all the sizes availables from the unique combo select on screen $('select[name^="group_"] option').each(function(){ if (sizeList[this.text]==undefined){ sizeList[this.text]=$(this).val(); // get size list option values } }); var currentColor; currentColor=combination.attributes_values[colorAttributteID]; // get current color renewSizeList(sizeList, currentColor); // Catch the click on color attribute $('[name=group_'+ colorAttributteID +']').parent().children('ul').children('li').children('a').click(function(){ currentColor=$(this).attr('name'); renewSizeList(sizeList, currentColor); }); }); //Clear the combo select and set the combo with the corresponding sizes values for the choosen color function renewSizeList(sizeList, currentColor){ $('select[name^="group_"]').empty(); //clear list var theSize; var sizeAttrID; sizeAttrID = $('select[name^="group_"]').attr( 'id' ).substr(6); //Get the id of the for(var key in combinationsFromController) { if (combinationsFromController[key].attributes_values[colorAttributteID]==currentColor){ //if this combination with current color theSize=combinationsFromController[key].attributes_values[sizeAttrID]; $('select[name^="group_"]').append('<option value="'+sizeList[theSize]+ '" title="'+theSize+ '">' +theSize+'</option>'); //build the select again } } // Sort the combo list $(function() { // choose target dropdown var select = $('select[name^="group_"]'); select.html(select.find('option').sort(function(x, y) { // to change to descending order switch "<" for ">" return $(x).text() > $(y).text() ? 1 : -1; })); //Set the first option selected $('select[name^="group_"] option:first').attr('selected','selected'); // Set the current value on screen - in PS above the combo select there is a <span> tag $('select[name^="group_"]').prev().text($('select[name^="group_"] option:first').text()); }); }; I hope this works!! regards the part of the code: I think also is combinationS and not combination, to avoid combination is not defined error currentColor=combination.attributes_values[colorAttributteID]; // get current color gave in console this error: Uncaught TypeError: Cannot read property '3' of undefined. I still using 1.6.1.18 version .. there is some fix or change to do? Thanks Link to comment Share on other sites More sharing options...
Casper_O Posted January 25, 2019 Share Posted January 25, 2019 On 6/9/2018 at 3:31 PM, nadie said: Free module of the user -> https://www.prestashop.com/forums/profile/296558-w3bsolutions/ Attachment module hideunavailablecombinations.zip Is for Prestashop 1.6 Hide Nonexistent combinations PS 1.6 This module hides non-existent combinations of the product page in PS 1.6, they are not used to choose them. This avoids the message "this combination does not exist, please choose another one". * It only works if all the attributes are shown as drop-down Sorry for my English I looked at this module, it do look promising, but seems not to work for me at 1.6 - sadly the author is not going to maintain it anymore. Any had their luck with this solution for 1.6.1.20? Maybe it is a theme related issue, i am not sure? Link to comment Share on other sites More sharing options...
w3bsolutions Posted September 28, 2019 Share Posted September 28, 2019 On 1/25/2019 at 12:32 PM, Casper_O said: I looked at this module, it do look promising, but seems not to work for me at 1.6 - sadly the author is not going to maintain it anymore. Any had their luck with this solution for 1.6.1.20? Maybe it is a theme related issue, i am not sure? Hi, the module has several hundred downloads (via my website too) and I have not received any message that it is not working on PS 1.6.1.20. In fact, I am using it on several PS 1.6.1.24 installations. It could be a theme issue. Could you provide a link to a product page where it is not working? Cheers. Link to comment Share on other sites More sharing options...
Casper_O Posted October 8, 2019 Share Posted October 8, 2019 Hi Its a long time since, but i just checked and the module is deactivated on that project. As far i remember we found an other solution. I can tell you it was a clean store with "Warehouse theme", but i sadly don't have time right now to do more in depth check with it. Best Regards Casper Link to comment Share on other sites More sharing options...
kamjosi Posted March 23, 2020 Share Posted March 23, 2020 Hello, shouldn´t this be integrated in PS1.7? I can remember that I successfully checked this before the update, but now that the shop is almost finished I just noticed that it doesn't work again. Link to comment Share on other sites More sharing options...
w3bsolutions Posted March 24, 2020 Share Posted March 24, 2020 1 hour ago, kamjosi said: Hello, shouldn´t this be integrated in PS1.7? I can remember that I successfully checked this before the update, but now that the shop is almost finished I just noticed that it doesn't work again. No, AFAIK this functionality has never been part of Prestashop core. Also not in 1.7. Link to comment Share on other sites More sharing options...
kamjosi Posted March 24, 2020 Share Posted March 24, 2020 So is there still this Module from you and does it work on 1.7.6.3? Link to comment Share on other sites More sharing options...
JBW Posted March 24, 2020 Share Posted March 24, 2020 In 1.7.6.3. this works by default without extra module Link to comment Share on other sites More sharing options...
w3bsolutions Posted March 24, 2020 Share Posted March 24, 2020 3 hours ago, JBW said: In 1.7.6.3. this works by default without extra module Yes, you are right! I just tested and can confirm this works fine in PS 1.7.6. Link to comment Share on other sites More sharing options...
kamjosi Posted March 24, 2020 Share Posted March 24, 2020 ok, then my memory was not wrong. But I tested it today morning and it do not work anymore. I figured out that the wright combinations appear after reloading the website but the attributes do not adjust by themself currently. need to figure out whats the problem. Thanks so far. Link to comment Share on other sites More sharing options...
Lucas Posted August 13, 2020 Share Posted August 13, 2020 (edited) My store has the regular color / size combinations and this behavior is horrible. I have this issue at version 1.7.6.7 and is causing a lot of incorrect orders since I moved from 1.6, so I went ahead and debug the code. After a while I think I'd found the bug and post a PR here: https://github.com/PrestaShop/PrestaShop/pull/20565 It is really late by now but it works. With that you only see what you can buy and it let you switch to other combinations that have stock. It also allows the "allow to order without stock" if you enable it. That part of the code was really complex to find/debug and I'm exhausted, so probably the PR will get rejected by code standards or something like that. If anyone is willing to test that code and post the comments in the PR or just modify it to apply the PR standards I'll really appreciate the help. Edited September 17, 2020 by Lucas (see edit history) Link to comment Share on other sites More sharing options...
ELEGANTAL Posted September 14, 2020 Share Posted September 14, 2020 There are 2 settings in Shop Parameters / Product Settings page that should be disabled: "Display unavailable product attributes on the product page" => should be NO "Allow ordering of out-of-stock products" => should be NO Link to comment Share on other sites More sharing options...
riga75 Posted February 10, 2021 Share Posted February 10, 2021 (edited) On 9/14/2020 at 9:28 PM, ELEGANTAL said: There are 2 settings in Shop Parameters / Product Settings page that should be disabled: "Display unavailable product attributes on the product page" => should be NO "Allow ordering of out-of-stock products" => should be NO I have set them to no both but if I enter the product page I always see the color not available. Where am I wrong? I have 1.7.7.0 version thanks a lot Edited February 10, 2021 by riga75 (see edit history) Link to comment Share on other sites More sharing options...
Lucas Posted February 11, 2021 Share Posted February 11, 2021 @riga75, it looks like my patch has been pushed until 1.7.8.0.... You may apply the patch manually into your PS installation (make sure you have a good backup of controllers/front/ProductController.php before continuing) It is only one file https://github.com/PrestaShop/PrestaShop/pull/20565/files or you can also run https://github.com/PrestaShop/PrestaShop/pull/20565.patch Best, Link to comment Share on other sites More sharing options...
feedtaleone Posted February 14, 2021 Share Posted February 14, 2021 (edited) On 3/14/2018 at 9:32 PM, vinefreshtees said: I have the same problem as well. I sell clothing and have several colors that aren't offered in a 4XL so I left off the combination for the 4XL colors that aren't available. On my product page when 4XL is selected it shows all colors, not just the ones available for 4XL. You have to click each color to find out which ones are available. I get the This combination does not exist for this product. Please select another combination message as well. I have Display unavailable product attributes on the product page already set to no. Was a solution to this ever found? Damm even I am having a similar kind of issue, I have searched all over the internet and even have posted on number of threads on different forum, no solution seems to work. I am really frustrated, can anyone of you here help me resolve this issue, I am very much tired now. get-vidmate.com instasave.onl Edited February 18, 2021 by feedtaleone (see edit history) Link to comment Share on other sites More sharing options...
JBW Posted February 15, 2021 Share Posted February 15, 2021 Maybe my module "Attribute Price and Availability Display" will be useful for you. I does not hide the combination but disables them if desired. Check it out in the addon store:https://addons.prestashop.com/en/product.php?id_product=50460 Link to comment Share on other sites More sharing options...
boyjaat209 Posted June 10, 2021 Share Posted June 10, 2021 (edited) Ensure that the products have the option: When out of stock -> Default (in the Quantities section) to get the Default configuration (in this case, Deny orders). With this configuration, the unavailable stock combinations will not appear in the Product page Edited June 12, 2021 by boyjaat209 (see edit history) Link to comment Share on other sites More sharing options...
nimra Posted August 30, 2021 Share Posted August 30, 2021 (edited) On 6/1/2018 at 6:03 PM, Mariano said: Hi everybody, I was able to solve this feature for my needs. I tested on PS 1.6.1.17 Sorry for my english. I took the base from https://github.com/redwert/prestashop-color-and-size For a shoes sell site, I needed to manage several size attributes. (men size, women size, child size, mix size) I used 1 combo select and colors attribute for every product (more than one combo select is not needed for my purpose). Example: for a product I have Red -> 7, 8, 9, 10 Blue -> 8,9,10 White -> 7,9 When I click on Red, the combo is setting with size 7,8,9,10. Click on Blue, the combo only shows 8,9,10, etc. The unavailable combinations doesn't shows. The difference with https://github.com/redwert/prestashop-color-and-size is that the "ID Size attribute" may vary (men size, women size, child size, mix size). For clothes Size possibly one "ID Size attribute" is enough. Thats why I assert dinamically the prefix "group_" for the select combo. The code for HideUnavailableSizesnew.js is var colorAttributteID='3'; // Set your color attribute ID - in my case is 3 $(document).ready(function(){ var sizeList={}; // Get all the sizes availables from the unique combo select on screen $('select[name^="group_"] option').each(function(){ if (sizeList[this.text]==undefined){ sizeList[this.text]=$(this).val(); // get size list option values } }); var currentColor; currentColor=combination.attributes_values[colorAttributteID]; // get current color renewSizeList(sizeList, currentColor); // Catch the click on color attribute $('[name=group_'+ colorAttributteID +']').parent().children('ul').children('li').children('a').click(function(){ currentColor=$(this).attr('name'); renewSizeList(sizeList, currentColor); }); }); //Clear the combo select and set the combo with the corresponding sizes values for the choosen color function renewSizeList(sizeList, currentColor){ $('select[name^="group_"]').empty(); //clear list var theSize; var sizeAttrID; sizeAttrID = $('select[name^="group_"]').attr( 'id' ).substr(6); //Get the id of the for(var key in combinationsFromController) { if (combinationsFromController[key].attributes_values[colorAttributteID]==currentColor){ //if this combination with current color theSize=combinationsFromController[key].attributes_values[sizeAttrID]; $('select[name^="group_"]').append('<option value="'+sizeList[theSize]+ '" title="'+theSize+ '">' +theSize+'</option>'); //build the select again } } // Sort the combo list $(function() { // choose target dropdown var select = $('select[name^="group_"]'); select.html(select.find('option').sort(function(x, y) { // to change to descending order switch "<" for ">" return $(x).text() > $(y).text() ? 1 : -1; })); //Set the first option selected $('select[name^="group_"] option:first').attr('selected','selected'); // Set the current value on screen - in PS above the combo select there is a <span> tag $('select[name^="group_"]').prev().text($('select[name^="group_"] option:first').text()); }); }; I hope this works!! regards is it available for PS 1.7. ? actually am not be able to upload this module to my PS website then i found another way to add given js to my custom.js file. Edited August 30, 2021 by nimra (see edit history) Link to comment Share on other sites More sharing options...
Kaper Posted October 8, 2021 Share Posted October 8, 2021 On 8/13/2020 at 8:20 AM, Lucas said: My store has the regular color / size combinations and this behavior is horrible. I have this issue at version 1.7.6.7 and is causing a lot of incorrect orders since I moved from 1.6, so I went ahead and debug the code. After a while I think I'd found the bug and post a PR here: https://github.com/PrestaShop/PrestaShop/pull/20565 It is really late by now but it works. With that you only see what you can buy and it let you switch to other combinations that have stock. It also allows the "allow to order without stock" if you enable it. That part of the code was really complex to find/debug and I'm exhausted, so probably the PR will get rejected by code standards or something like that. If anyone is willing to test that code and post the comments in the PR or just modify it to apply the PR standards I'll really appreciate the help. Hello, is there any solution for 1.6 ? Thanks 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