ioanas Posted June 30, 2014 Share Posted June 30, 2014 Hi, I'm trying to hide tabs in product.tpl based on manufacturer id. if manufacturer id =17 or 18 or 19 the i what the tab to be visible else i need it to be hidden this is the code i whant to modify: <ul id="more_info_tabs" class="idTabs idTabsShort clearfix"> {if $product->description}<li><a id="more_info_tab_more_info" href="#idTab1">{l s='More info'}</a></li>{/if} {if $features}<li><a id="more_info_tab_data_sheet" href="#idTab2" class="selected">{l s='Data sheet'}</a></li>{/if} {if (isset($quantity_discounts) && count($quantity_discounts) > 0)}<li><a id="more_info_tab_quantity" href="#discount_tab">{l s='Quantity discount'}</a></li>{/if} {if $attachments}<li><a id="more_info_tab_attachments" href="#idTab9">{l s='Download'}</a></li>{/if} {if isset($product) && $product->customizable}<li><a href="#idTab10">{l s='Product customization'}</a></li>{/if} {$HOOK_PRODUCT_TAB} the tab i need to be hidden/visible based on manufacturer id is "#idTab1" any help is much appreciated, Best regards, Bogdan Link to comment Share on other sites More sharing options...
vekia Posted June 30, 2014 Share Posted June 30, 2014 hello you can use if condition like: {if $product->id_manufacturer!=19 || $product->id_manufacturer!=18 || $product->id_manufacturer!=17} //do something {/if} code above means if product id_manufacturer is different than 19,18,16 - then display something (do something) just paste there tabs & their contents Link to comment Share on other sites More sharing options...
ioanas Posted June 30, 2014 Author Share Posted June 30, 2014 i will try this tomorrow an my local installation of prestashop at work. Thanks Link to comment Share on other sites More sharing options...
ioanas Posted July 1, 2014 Author Share Posted July 1, 2014 (edited) hello you can use if condition like: {if $product->id_manufacturer!=19 || $product->id_manufacturer!=18 || $product->id_manufacturer!=17} //do something {/if} code above means if product id_manufacturer is different than 19,18,16 - then display something (do something) just paste there tabs & their contents i cant make this work. i'm sure i'm doing something wrong this is the link to my website product http://www.optiplaza.ro/rayban/2406-rayban-rb3016-w0365-51.html i need to make the "INFORMATII" TAB HIDDEN when the product displayed is sunglasses, and visible when the product is contact lenses. My contact lenses manufacturer id are 14, 15, 17. that's way i'm trying to use this to now when the "informatii" tab should be visible or not <!-- description and features --> {if (isset($product) && $product->description) || (isset($features) && $features) || (isset($accessories) && $accessories) || (isset($product) && $product->customizable) || (isset($HOOK_PRODUCT_TAB) && $HOOK_PRODUCT_TAB) || (isset($attachments) && $attachments)} <div id="more_info_block" class="clear"> <ul id="more_info_tabs" class="idTabs idTabsShort clearfix"> {if $product->description}<li><a id="more_info_tab_more_info" href="#idTab1">{l s='More info'}</a></li>{/if} {if $features}<li><a id="more_info_tab_data_sheet" href="#idTab2">{l s='Data sheet'}</a></li>{/if} {if (isset($quantity_discounts) && count($quantity_discounts) > 0)}<li><a id="more_info_tab_quantity" href="#discount_tab">{l s='Quantity discount'}</a></li>{/if} {if $attachments}<li><a id="more_info_tab_attachments" href="#idTab9">{l s='Download'}</a></li>{/if} {if isset($product) && $product->customizable}<li><a href="#idTab10">{l s='Product customization'}</a></li>{/if} {$HOOK_PRODUCT_TAB} </ul> the code above is from my website, i managed to hide the "INFORMATII" TAB but it hides from all products, sunglasses or/and contact lenses. how can i make this to work? Thanks Edited July 1, 2014 by ioanas (see edit history) Link to comment Share on other sites More sharing options...
ioanas Posted July 1, 2014 Author Share Posted July 1, 2014 i manage to make it work. hope that i don't mess anything up. i modified the code like this: <!-- description and features --> {if (isset($id_manufacturer) && $id_manufacturer) || (isset($product) && $product->description) || (isset($features) && $features) || (isset($accessories) && $accessories) || (isset($product) && $product->customizable) || (isset($HOOK_PRODUCT_TAB) && $HOOK_PRODUCT_TAB) || (isset($attachments) && $attachments)} <div id="more_info_block" class="clear"> <ul id="more_info_tabs" class="idTabs idTabsShort clearfix"> <!--{if $product->description}<li><a id="more_info_tab_more_info" href="#idTab1">{l s='More info'}</a></li>{/if} --> {if $product->id_manufacturer ==14 || $product->id_manufacturer ==15 || $product->id_manufacturer ==17}<li><a id="more_info_tab_more_info" href="#idTab1">{l s='More info'}</a></li>{/if} {if $features}<li><a id="more_info_tab_data_sheet" href="#idTab2" >{l s='Data sheet'}</a></li>{/if} {if (isset($quantity_discounts) && count($quantity_discounts) > 0)}<li><a id="more_info_tab_quantity" href="#discount_tab">{l s='Quantity discount'}</a></li>{/if} {if $attachments}<li><a id="more_info_tab_attachments" href="#idTab9">{l s='Download'}</a></li>{/if} {if isset($product) && $product->customizable}<li><a href="#idTab10">{l s='Product customization'}</a></li>{/if} {$HOOK_PRODUCT_TAB} </ul> <div id="more_info_sheets" class="sheets align_justify"> {if $product->id_manufacturer ==14 || $product->id_manufacturer ==15 || $product->id_manufacturer ==17} {if isset($product) && $product->description} <!-- full description --> <div id="idTab1" class="rte">{$product->description}</div> {/if} {/if} if this is not the right way please leave a comment. thanks vekia for your support Link to comment Share on other sites More sharing options...
vekia Posted July 1, 2014 Share Posted July 1, 2014 i manage to make it work. hope that i don't mess anything up. i modified the code like this: <!-- description and features --> {if (isset($id_manufacturer) && $id_manufacturer) || (isset($product) && $product->description) || (isset($features) && $features) || (isset($accessories) && $accessories) || (isset($product) && $product->customizable) || (isset($HOOK_PRODUCT_TAB) && $HOOK_PRODUCT_TAB) || (isset($attachments) && $attachments)} <div id="more_info_block" class="clear"> <ul id="more_info_tabs" class="idTabs idTabsShort clearfix"> <!--{if $product->description}<li><a id="more_info_tab_more_info" href="#idTab1">{l s='More info'}</a></li>{/if} --> {if $product->id_manufacturer ==14 || $product->id_manufacturer ==15 || $product->id_manufacturer ==17}<li><a id="more_info_tab_more_info" href="#idTab1">{l s='More info'}</a></li>{/if} {if $features}<li><a id="more_info_tab_data_sheet" href="#idTab2" >{l s='Data sheet'}</a></li>{/if} {if (isset($quantity_discounts) && count($quantity_discounts) > 0)}<li><a id="more_info_tab_quantity" href="#discount_tab">{l s='Quantity discount'}</a></li>{/if} {if $attachments}<li><a id="more_info_tab_attachments" href="#idTab9">{l s='Download'}</a></li>{/if} {if isset($product) && $product->customizable}<li><a href="#idTab10">{l s='Product customization'}</a></li>{/if} {$HOOK_PRODUCT_TAB} </ul> <div id="more_info_sheets" class="sheets align_justify"> {if $product->id_manufacturer ==14 || $product->id_manufacturer ==15 || $product->id_manufacturer ==17} {if isset($product) && $product->description} <!-- full description --> <div id="idTab1" class="rte">{$product->description}</div> {/if} {/if} if this is not the right way please leave a comment. thanks vekia for your support it's allright :-) topic marked as solved 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