Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

How Would I Check If A Feature Has No Value Rate Topic   - - - - -

 
  • DonovanRuc
  • Newbie
  • Trial users
  • Join Date: 01-Nov 19
  • 2 posts

Posted 24 November 2019 - 10:41 PM #1

I am looking to check if a feature has no value for a specific product. Right now we are using a feature to add text to a box on our product template. 

 

Here is an example of the code: 

                <div class="overlay-text">
                                {foreach from=$product.product_features item="feature"}
        	{if $feature.description == 'Shipping Block'}
	        	<p>{$feature.value}</p>
        	{/if}
            {/foreach}
                    </div>

How would I check if the feature has no value and then display a generic line of text? 



 
  • DonovanRuc
  • Newbie
  • Trial users
  • Join Date: 01-Nov 19
  • 2 posts

Posted 28 December 2019 - 04:51 AM #2

I tried the following but still no luck.

 

<div class="overlay-text">
{foreach from=$product.product_features item="feature"}
    {if $feature.description == 'Shipping Block'}
        {if $feature.value == ''}

<p>Generic Text</p>

{else} 

<p>{$feature.value}</p>

{/if}
{/foreach}

</div>