将批量产品list.tpl中的Prestashop
问题描述:
我使用的是默认主题的Prestashop将批量产品list.tpl中的Prestashop
我发现在我要添加代码的产品,list.tpl(〜191线)的地方而要显示的库存水平,如果低于10
我添加
{LS = '警告:剩余股票:'} {$产品 - >量}
但这段代码没有任何数字出现 - 我假设$ product->数量为空。 这是一个缺少的SQL查询。并没有从数据库中获取属性?
答
有$product
是数组,而不是一个对象,并在Smarty的模板,你可以访问数组元素的下一个方法:
{l s='Warning: remaining stock : '}{$product.quantity}
答
感谢 继承人是我想做的事情 (约行191)
{if $product.quantity <= 10}
<span class="label-warning">{l s=' in stock : '} {$product.quantity}</span> {else}
<span> class="label-warning">{l s='in stock : >10'}</span> {/if}