X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Hiding Feature Comparison Tabbed Menu Item (https://forum.x-cart.com/showthread.php?t=35812)

wardworth 11-30-2007 03:20 AM

Hiding Feature Comparison Tabbed Menu Item
 
Hi,

I have modified my product.tpl so that all of my feature comparison fields and values appear in a tabbed menu below rather than in the actual product.tpl.

However, some of the products do not have feature comparison fields and values therefore I would like to hide the feature comparison tab and content if these fields and values are empty. How do I go about doing this?

mistaegoista 01-11-2008 04:55 AM

Re: Hiding Feature Comparison Tabbed Menu Item
 
Simple.

You just say in your template: if there is a value in the feature comparison field, display it (otherwise the field will be automatically ignored).

The code taken from product.tpl should be like something this:

{if $v.value}
<tr>
<td width="30%" valign="top">{$v.option_name}</td>
<td>
{if $v.option_type eq 'S'}
{$v.variants[$v.value].name}
{elseif $v.option_type eq 'M'}
{foreach from=$v.variants item=o}
{if $o.selected ne ''}{$o.name}<br />{/if}
{/foreach}
{elseif $v.option_type eq 'B'}
{if $v.value eq 'Y'}{$lng.lbl_yes}{else}{$lng.lbl_no}{/if}
{elseif ($v.option_type eq 'N' || $v.option_type eq 'D') && $v.value ne ''}
{$v.formated_value}
{else}
{$v.value|replace:"\n":"<br />"}
{/if}
</td>
</tr>
{/if}

All you have to do is encapsulate the feature comparison field within the bold code, as shown above.

Hope that helps!

Regards, mE

Tdeviant 08-05-2010 01:33 PM

Re: Hiding Feature Comparison Tabbed Menu Item
 
Hi i am having a similar problem, I wish to hide all the fields that say: No, None or have a boolean no, from the product description page, please help

http://sleepywings.co.uk/home.php?shopkey=123

http://sleepywings.co.uk/Shorty-2.html


All times are GMT -8. The time now is 10:54 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.