Displaying A Product Tab Only When Price Is > Xx

I am trying to make one product tab disappear, if the product price is lower than for example 100

in addons/mychanges/override/views/tabs/components/product_tabs.tpl I've got an override that changes some things.

I struggle to make a proper condition

{if $product.price > 100 && $tab_id == 18}

and how to assign "D"eactivated value into status?

Any hints

{if $product.price > 100 && $tab_id == 18}
  {$tab.status = "D"};
{/if}

{if $tab.show_in_popup != "Y" && $tab.status == "A"}
            {assign var="tab_content_capture" value="tab_content_capture_`$tab_id`"}
.
.
.
.etc

but its not good practice . tab should be block from controller (controller "product" & mode "view || quick_view").


I hope it will be help you.

Thank you vivek. I've tried it, it works partially, the condition is passed correctly, but the status is not changed to D, because the tab is still showing.

You've said its not a good practice, what could be the downside of this solution?

What information does your tab contain? Is it just HTML block?

Yes, html block with smarty. I also wanted to include the product name in the block.

Yes, html block with smarty. I also wanted to include the product name in the block.

If the HTML block with Smarty support is used, try to add the following code to its content:

{if $product.price > 100}
   BLOCK CONTENT
{/if}

Do not modify core files

Thank you eComLabs, it does work, meaning the content of the block is not displaying, but the tab itself is displaying empty.

I tried:

{if $product.price > 100}
{$tab.status = "D"}
{/if}
{if $product.price < 100}
BLOCK CONTENT
{/if}

But it didnt work

Thank you eComLabs, it does work, meaning the content of the block is not displaying, but the tab itself is displaying empty.

I tried:

{if $product.price > 100}
{$tab.status = "D"}
{/if}
{if $product.price < 100}
BLOCK CONTENT
{/if}

But it didnt work

OK. I thought that the system will not show empty tabs. In this case changes in the product_tabs.tpl file are also required