【问题标题】:PrestaShop Print Features in product list产品列表中的 PrestaShop 打印功能
【发布时间】:2015-07-31 16:52:39
【问题描述】:

我对产品列表中的打印功能有一个问题:

{if isset($product.features)}
    <div class="features">
         {foreach from=$product.features item=feature}
                <table class="feature-pl">
                <tr>
                      <td class="fea-name">{$feature.name}</td>
                      <td class="fea-valu">{$feature.value}</td>
                </tr>
                </table>
          {/foreach}
    </div>
{/if}

但我只想打印其中的 2 个功能,我该怎么做呢?

【问题讨论】:

    标签: php html prestashop


    【解决方案1】:

    我知道它不是很优雅,但你可以这样做:

    {if isset($product.features)}
    <div class="features">
         {foreach from=$product.features item=feature}
            {if $feature.name eq "Feature1" or $feature.name eq "Feature2" }
                <table class="feature-pl">
                <tr>
                      <td class="fea-name">{$feature.name}</td>
                      <td class="fea-valu">{$feature.value}</td>
                </tr>
                </table>
            {/if}
          {/foreach}
    </div>
    {/if}
    

    【讨论】:

      猜你喜欢
      • 2014-08-14
      • 1970-01-01
      • 2015-07-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-22
      相关资源
      最近更新 更多