KORG23 Posted March 17, 2014 Share Posted March 17, 2014 Hello,I need a help. I searched a lot for the solution but couldn't figure it out yet. Some people have already started the topic but it definitely doesn't work for me.I have plenty of product attributes that I don't want to show up in my product display but the fact is that I need them all in the blocklayerd. I know I need to edit the product.tpl file located in my theme folder and add some code around : <fieldset class="attribute_fieldset"> NEW CODE HERE <label class="attribute_label" for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :</label> {assign var="groupName" value="group_$id_attribute_group"} For some people I believe this worked out : {if $id_attribute_group == 2}style="display: none;"{/if} but it doesn't work in my case. So, I found another code : {if $id_attribute_group eq 2}style="display: none;"{/if} And still, doesn't work at all! My PS version is 1.5.6.2Please, I really need to get it done. Thanks Link to comment Share on other sites More sharing options...
Maskca Posted March 17, 2014 Share Posted March 17, 2014 (edited) In your product.tpl file you can find code: <div id="attributes"> <div class="clear"></div> {foreach from=$groups key=id_attribute_group item=group} {if $group.attributes|@count} <fieldset class="attribute_fieldset"> <label class="attribute_label" for="group_{$id_attribu .......... Try write to it this changes(4 row in code above): {if $group.attributes|@count && $id_attribute_group != 2} Edited March 17, 2014 by Maskca (see edit history) 1 Link to comment Share on other sites More sharing options...
KORG23 Posted March 17, 2014 Author Share Posted March 17, 2014 Dear Maskca, Awesome! It's working fine. Thank you so much for your support. Link to comment Share on other sites More sharing options...
KORG23 Posted March 23, 2014 Author Share Posted March 23, 2014 Dear Maskca, I have a little question about the code your provided me. I'd like to add another attribute to hide. I tried his : {if $group.attributes|@count && $id_attribute_group != 2 OR 4} But it's doesn't work at all... When I refresh my product display, I reach a blank page... Coud you tell me how to add more attribute to hide ? Please, I need to get it done. Thanks Link to comment Share on other sites More sharing options...
Maskca Posted March 23, 2014 Share Posted March 23, 2014 Hello, try this: {if $group.attributes|@count && $id_attribute_group != 2 && $id_attribute_group != 4} 1 Link to comment Share on other sites More sharing options...
KORG23 Posted March 23, 2014 Author Share Posted March 23, 2014 This is working perfectly! Thank you very much. Link to comment Share on other sites More sharing options...
KORG23 Posted March 28, 2014 Author Share Posted March 28, 2014 Hi again Maskca ! I've a last question about how to hide attribute properly! Again, I've searched quite a lot but I haven't found the answer yet. My question is : How to hide attribute on the display product if there is only one choice ? For exemple, in my shop, I need to add color to every single product even if there is only one color for each product. In fact, the client doesn't have choice of the color so there is no need to show up that! But if there is 2 choices of color, of course, it's important to show back the attributes. Do you have any idea how to do that ? Thanks again for your precious help. Link to comment Share on other sites More sharing options...
spc Posted June 20, 2014 Share Posted June 20, 2014 HelloI follow this tutorial, And now i can´t find my add to cart button.It´s just disappeared....I use PS 1.6.0.6 {if $group.attributes|@count && $id_attribute_group != 1 && $id_attribute_group != 3 && $id_attribute_group != 4 && $id_attribute_group != 5 && $id_attribute_group != 7 && $id_attribute_group != 8 && $id_attribute_group != 9} Link to comment Share on other sites More sharing options...
Maskca Posted June 25, 2014 Share Posted June 25, 2014 (edited) Hi again Maskca ! I've a last question about how to hide attribute properly! Again, I've searched quite a lot but I haven't found the answer yet. My question is : How to hide attribute on the display product if there is only one choice ? For exemple, in my shop, I need to add color to every single product even if there is only one color for each product. In fact, the client doesn't have choice of the color so there is no need to show up that! But if there is 2 choices of color, of course, it's important to show back the attributes. Do you have any idea how to do that ? Thanks again for your precious help. Hi, sorry for long answer, find this in product.tpl: <div id="attributes"> {foreach from=$groups key=id_attribute_group item=group} {if $group.attributes|@count} <fieldset class="attribute_fieldset"> <label class="attribute_label" for="group_ And write this, instead of third row: {if count($group.attributes) > 1} Edited June 25, 2014 by Maskca (see edit history) Link to comment Share on other sites More sharing options...
Maskca Posted June 25, 2014 Share Posted June 25, 2014 Hello I follow this tutorial, And now i can´t find my add to cart button. It´s just disappeared.... I use PS 1.6.0.6 {if $group.attributes|@count && $id_attribute_group != 1 && $id_attribute_group != 3 && $id_attribute_group != 4 && $id_attribute_group != 5 && $id_attribute_group != 7 && $id_attribute_group != 8 && $id_attribute_group != 9} Hi, in PS 1.6 try this: <fieldset style="{if $id_attribute_group==1 || $id_attribute_group==3} display: none; {/if}" class="attribute_fieldset"> 1 Link to comment Share on other sites More sharing options...
wiseprt Posted April 1, 2015 Share Posted April 1, 2015 (edited) Hello, i changed the third row as you said, but now the cart button also dissapearing, i want to hide the attribute if there is only one. I am using the latest 1.6.0.14. Hi, sorry for long answer, find this in product.tpl: <div id="attributes"> {foreach from=$groups key=id_attribute_group item=group} {if $group.attributes|@count} <fieldset class="attribute_fieldset"> <label class="attribute_label" for="group_And write this, instead of third row: {if count($group.attributes) > 1} Best Regards Edited April 1, 2015 by wiseprt (see edit history) Link to comment Share on other sites More sharing options...
Maskca Posted April 23, 2015 Share Posted April 23, 2015 Hi, try this on 4 line: <fieldset {if count($group.attributes) == 1} style="display: none" {/if} class="attribute_fieldset"> 1 Link to comment Share on other sites More sharing options...
Prskavka Posted June 26, 2015 Share Posted June 26, 2015 Hi, try this on 4 line: <fieldset {if count($group.attributes) == 1} style="display: none" {/if} class="attribute_fieldset"> Great, thank you, but the label is still on Link to comment Share on other sites More sharing options...
Maskca Posted June 26, 2015 Share Posted June 26, 2015 Hi, can you show link on this page? Link to comment Share on other sites More sharing options...
wimogas Posted July 16, 2015 Share Posted July 16, 2015 Hello, can I hide values of attributes depending on other attributes selected? scenario: attribute 1: - model 1 - model 2 Attribute 2: - 100 units - 200 units Model 1 has 100 units, but not 200 units. Therefore, when the first dropdown selects model 1, i don't want the second dropdown to show 200 units. Does it make sense? Thanks, Guillem Link to comment Share on other sites More sharing options...
iHairBeauty Posted May 13, 2016 Share Posted May 13, 2016 (edited) Hi, try this on 4 line: <fieldset {if count($group.attributes) == 1} style="display: none" {/if} class="attribute_fieldset"> I have used this but now the page does not load (just get a blank screen) I presume i swap the 1 for the Attribute ID (in my case 6) If i put it between lines 4 and 5, nothing happens (page works as normal unless it is set to 1, in which case I get No Attributes) Using the Multi Attribute option earlier and throwing almost random numbers into BOTH values (reduce it to one value it doesn't appear to work) I have pointed it at a deleted group (1) and the group I want to hide (6) in that order and it appears to work when added between lines 4 and 5 (not replacing 4). Am I just going crazy? using prestashop 1.6.1.1 Using the earlier option did hide the attribute set, but it also meant the cart button was disabled. I need to have a hidden Generic colour (e.g. black, red, blue etc) and the actual colour (Ebony, Coal, Magenta, Flame, Sky Blue, Azure etc) so I can filter by the Generic colour for customers in the layered navigation. Edited May 13, 2016 by iHairBeauty (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts