Jump to content

How make conditional attributes


Recommended Posts

Hello! I need to know how to make product attributes that are conditional. For example, there are two main attributes A and B. If the user selects the attribute A, new options c, d and e appear. Conversely, if you select the B attribute options appear f y g.

 

That is, I need that from selecting an attribute, different options according to the selected appear.

 

Someone knows a way to do this? I have some topics talking about this, but none reached a solution.

From already thank you very much !!!

Link to comment
Share on other sites

These work if you have few options

 

You need change your product.tpl

 

1) Look for  <div id="attributes">

 

2) then {foreach from=$groups key=id_attribute_group item=group} here you can read your attributes

 

3) you can read each attribute and show or hide attributes with a display:none

 

4) use the product.js to add jquery to show or hide the atrributes

Link to comment
Share on other sites

PrestaShop already has conditional attributes, it just displays all of the attributes, and shows a message that the combination does not exist if you select one that does not have a combination.

 

Our Attribute Wizard module lets you hide / disable unavailable combinations, see http://demo.presto-changeo.com/attributewizard/tshirts/1-faded-short-sleeve-tshirts.html (full module at http://www.presto-changeo.com/en/attribute-modules/23-attribute-wizard.html )

 

Keep in mind that the combinations still need to have the proper PS structure, which means each combination MUST contain 1 attribute from each group.

Link to comment
Share on other sites

×
×
  • Create New...