prestashop - 在 prestashop 选项卡主页中显示特定类别
问题描述
我想在 prestashop 1.6 主页的新产品选项卡中仅显示来自特定类别的产品
我使用 blocknewproducts_home.tpl
我在下面尝试了此代码,但类别 114 中没有显示任何内容(附有获取产品)
{if $id_category == 114}
{include file="$tpl_dir./product-list.tpl" products=$new_products class='blocknewproducts tab-pane' id='blocknewproducts'}
{/if}
{if isset($new_products) && $new_products}
{include file="$tpl_dir./product-list.tpl" products=$new_products class='blocknewproducts tab-pane' id='blocknewproducts'}
{else}
<ul id="blocknewproducts" class="blocknewproducts tab-pane">
<li class="alert alert-info">{l s='No new products at this time.' mod='blocknewproducts'}</li>
</ul>
{/if}
谢谢你的帮助
解决方案
尝试宽度:{if $smarty.get.id_category == 114}
问候
推荐阅读
- bash - 如何捕获输入来控制截图功能?
- django - 如何序列化 DRF 中的注释和外键
- powershell - 使用 PowerShell 创建安装脚本
- html - 为什么画廊不隐藏完整的图像?
- html - 如何更改三列布局的不透明度
- javascript - 从 Google Maps Distance API 将 JSON 数据读入网页/html 表单
- c# - 切换到 MVVMLight 时出现 CanExecute 问题
- python - 使用来自 ipywidgets 的下拉小部件
- php - 使用 bash 脚本调用 PHP 方法
- gremlin - gremlin - 如何在单个查询中计算标准偏差?