【问题标题】:CS-Cart feature values on the list pages列表页面上的 CS-Cart 特征值
【发布时间】:2017-10-27 05:23:28
【问题描述】:

在 CS-Cart 中,如何在列表视图中获取单独的特征值? 在详细视图中,您可以通过执行以下操作获得任何可用的功能:

{$product.header_features.1.value} 

但在列表视图中,获取功能的唯一方法似乎是这样的:

{assign var="product_features" value="product_features_`$obj_id`"}
{$smarty.capture.$product_features nofilter}

这会导致以逗号分隔的列表包含在 div 中。如果该特征是一个数字,则意味着您最终会得到一个没有标签的无意义数字列表。

有没有办法让模板中的每个功能都可用,这样我就可以在每个功能之前添加图标?

【问题讨论】:

    标签: smarty cs-cart


    【解决方案1】:

    经过大量调查,我终于发现了这一行:

    {assign var="product_features" value="product_features_`$obj_id`"}
    

    正在从文件templates/common/product_data.tpl获取它的信息

    查看该文件清楚地表明它从文件views/products/components/product_features_short_list.tpl 中获取功能

    然后,要识别每个功能,我需要做的就是在 foreach 中添加一个包装,如下所示:

    <span class="grid-feature feature_{$feature.description|lower|replace:' ':'-' nofilter}"></span>
    

    CSS 可以完成剩下的工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-01-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多