2016-08-16 54 views

回答

2

使用:

{if $packItems|@count > 0} 

使用,你可以找到它在主題文件夾product.tpl的例子。以這種方式使用 :

{if $packItems|@count > 0} 
      <div class="short_description_pack"> 
      <h3>{l s='Pack content'}</h3> 
        {foreach from=$packItems item=packItem} 

        <div class="pack_content"> 
          {$packItem.pack_quantity} x <a href="{$link->getProductLink($packItem.id_product, $packItem.link_rewrite, $packItem.category)|escape:'html':'UTF-8'}">{$packItem.name|escape:'html':'UTF-8'}</a> 
          <p>{$packItem.description_short}</p> 
        </div> 
        {/foreach} 
      </div> 
    {/if} 
-1
此外

,有一個產品對象:

$product->id_pack_product_attribute = null 
$product->cache_is_pack = 0 

非包裝產品