Jump to content

Edit History

AureAure

AureAure

Hello,

I'm on PS 1.7.5 and I'm trying to display text on my product descriptions according to the product's features. 

I managed to do it with this code :

{block name='product_features'}
    {if $product.grouped_features}
{foreach from=$product.grouped_features item=feature}

{if $feature.id_feature == 18 && $feature.value=="Blue"}
 <div>
My text
</div>    
{/if}

{/foreach}
{/if}
  {/block}

 

It works well except if a product has several values from the same feature. Then it doesn't display anything.

For exemple with my code above:

If my product has two values (Blue and Yellow) from the feature with id 18 (Color), then the text doesn't display. If my product has only one value from this feature (Blue for exemple), it works well.

Can someone help me please ? Do someone knows why ?

Thank you very much for your help.

AureAure

AureAure

Hello,

I'm on PS 1.7.5 and I'm trying to display text on my product descriptions according to the product's caracteristics. 

I managed to do it with this code :

{block name='product_features'}
    {if $product.grouped_features}
{foreach from=$product.grouped_features item=feature}

{if $feature.id_feature == 18 && $feature.value=="Blue"}
 <div>
My text
</div>    
{/if}

{/foreach}
{/if}
  {/block}

 

It works well except if a product has several values from the same caracteristic. Then it doesn't display anything.

For exemple with my code above:

If my product has two values (Blue and Yellow) from the caracteristic with id 18 (Color), then the text doesn't display. If my product has only one value from this caracteristic (Blue for exemple), it works well.

Can someone help me please ? Do someone knows why ?

Thank you very much for your help.

AureAure

AureAure

Hello,

I'm on PS 1.7.5 and I'm trying to display text to my product descriptions according to the product's caracteristics. 

I managed to do it with this code :

{block name='product_features'}
    {if $product.grouped_features}
{foreach from=$product.grouped_features item=feature}

{if $feature.id_feature == 18 && $feature.value=="Blue"}
 <div>
My text
</div>    
{/if}

{/foreach}
{/if}
  {/block}

 

It works well except if a product has several values from the same caracteristic. Then it doesn't display anything.

For exemple with my code above:

If my product has two values (Blue and Yellow) from the caracteristic with id 18 (Color), then the text doesn't display. If my product has only one value from this caracteristic (Blue for exemple), it works well.

Can someone help me please ? Do someone knows why ?

Thank you very much for your help.

×
×
  • Create New...