L
L
lookingfor22020-02-07 09:21:13
MODX
lookingfor2, 2020-02-07 09:21:13

How to not display empty product options?

I now display all the characteristics
How to make it so that if there is no value, the key is not displayed

{do $options|sort: "desc"}
{foreach $options as $option}

  <div class="flex justify-content">
    <span class="label">{$option.caption}:</span>
    <span class="value">
        
      {if $option.value is array}
          
        {$option.value | join : ", "}
        {if $option.measure_unit}
          {$option.measure_unit}
      {/if}
      {else}
        {$option.value}
        {if $option.measure_unit}
          {$option.measure_unit}
        {/if}
      {/if}
    </span>
  </div>
{/foreach}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question