Jump to content

Recommended Posts

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.

Share this post


Link to post
Share on other sites

El Patron, if you read my first post you will see that I've already done this. Any other solutions?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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!!

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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 by Mariano (see edit history)

Share this post


Link to post
Share on other sites
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!!!

Share this post


Link to post
Share on other sites

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 by nadie
update message (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites
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

 

 

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More