【问题标题】:Opencart - Notice: Undefined index: saving inOpencart - 注意:未定义的索引:保存在
【发布时间】:2014-06-26 11:36:12
【问题描述】:

我正在使用 Opencart 1.5.6.1。

在此页面中: http://jefferson.com.my/test/index.php?route=product/results&category=[75]&path=0&filterProduct=1

部分产品存在错误, SAVE 注意:未定义索引:保存在 /home/jefferso/public_html/test/vqmod/vqcache/vq2-catalog_view_theme_pav_fashion_template_product_category.tpl 行 147%

这是因为我安装了一个显示折扣百分比的模组。 在分类页面、产品页面和主页显示没有问题,但是如果你尝试左边的过滤器(打勾T恤)导致上面的页面,就会出现错误。

我不知道如何处理那个缓存文件,主题开发者根本不想帮忙。

【问题讨论】:

  • 请在此处提及主题 vqmod 文件代码。转到您的站点源 > vqmod > xml > 并找到 yourtheme.xml 文件(可能是 xml 文件名将主题名称)。
  • 您好,该主题没有 VQmod。但是显示节省百分比 mod 是一个 vqmod 可以在这里找到:opencart.com/index.php?route=extension/extension/…
  • 嗨,我已经检查了它的扩展名。但是,它工作正常。请在此处提及您的 category.php 文件代码。 (目录 > 控制器 > 产品 > category.php)
  • 嗨 Harnish,您可以在这里查看 category.php 文件:pastebin.com/p0NfVF4e
  • 链接失效了。

标签: php jquery e-commerce opencart vqmod


【解决方案1】:

转到您的来源> vqmod > xml > & 然后找到并打开“webvet_percentage_to_specials_v6.xml”文件 > & 然后在页面底部</modification> 标签上方添加下面的代码。 > & 然后检查它。

// FILTER PAGE
<file name="catalog/controller/product/results.php">

    <operation>
        <search position="after"><![CDATA[
        'special'     => $special,
        ]]></search>

        <add><![CDATA[
        'saving'     => round((($result['price'] - $result['special'])/$result['price'])*100, 0),
        ]]></add>
    </operation>
</file>

<file name="catalog/view/theme/*/template/product/result.tpl">

    <operation>
        <search position="after"><![CDATA[
        <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
        ]]></search>

        <add><![CDATA[
        <br /><span style="color: red;">SAVE <?php echo $product['saving']; ?>%</span>
        ]]></add>
    </operation>
</file>

【讨论】:

    猜你喜欢
    • 2014-11-15
    • 2015-06-02
    • 2014-06-18
    • 2015-12-01
    • 2013-11-27
    • 2021-09-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多