产品列表中的 prestashop 比较按钮

问题描述

我想将比较按钮(存在于 product.tpl 中)添加到 product-list.tpl,我尝试复制存在于 product.tpl 中的代码

item.innerHTML = data.time

到product-list.tpl

{if isset($comparator_max_item) && $comparator_max_item}
        <div class="compare">
        <a class="add_to_compare" href="#" data-id-product="{$product->id|intval}" style="color:black;"><i class="fas fa-cubes" style="font-size:1.3em;padding-right:.4em;"></i> {l s='Add to Compare'}</a>
        </div>
        {/if}
        {include file="./product-compare.tpl"}
        </div>

        {*Products compare *}
        {addJsDefL name=min_item}{l s='Please select at least one product' js=1}{/addJsDefL}
        {addJsDefL name=max_item}{l s='You cannot add more than %d product(s) to the product comparison' sprintf=$comparator_max_item js=1}{/addJsDefL}
        {addJsDef comparator_max_item=$comparator_max_item}
        {addJsDef comparedProductsIds=$compared_products}

我不知道我错过了什么......有人可以提供一些灯吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)