Jump to content

Only one feature


Recommended Posts

Hi everyone,

 

I really need to add one feature after the title product on my product.tpl. Not only in the data sheet. I copy/paste this piece of code at the right place, but i've got the entire list of features of course....

{if isset($features) && $features}
		<!-- product's features -->
		<ul id="idTab2" class="bullet">
		{foreach from=$features item=feature}
            {if isset($feature.value)}
			    <li><span>{$feature.name|escape:'htmlall':'UTF-8'}</span> {$feature.value|escape:'htmlall':'UTF-8'}</li>
            {/if}
		{/foreach}
		</ul>
	{/if}

Please help me...

 

Thank you in advance

 

PS 1.5.6.2

Link to comment
Share on other sites

Use an if condition and validate it by the id of the feature, eg:

{if isset($features) && $features}
  {foreach from=$features item=feature}
    {if isset($feature.id_feature) && ($feature.id_feature == 1)}
      <li><span>{$feature.name|escape:'htmlall':'UTF-8'}</span> {$feature.value|escape:'htmlall':'UTF-8'}</li>
    {/if}
  {/foreach}
{/if}

Change ($feature.id_feature == 1) the "1" by the id you are looking for, good luck.

Link to comment
Share on other sites

  • 3 weeks later...

For people interested in this subjet, i've found the solution in another thread and it works great for PS 1.5.6.2 :

 

{foreach $product.features as $feature}
{if $feature.name == 'Your protection'}<p>{$feature.value|escape:'htmlall':'UTF-8'}</p>{/if}

{/foreach}
 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...