【问题标题】:"ADD TO CART" button not working in product view page in magento“添加到购物车”按钮在 magento 的产品视图页面中不起作用
【发布时间】:2015-03-19 12:08:14
【问题描述】:

我们希望客户在产品视图页面上输入邮政编码,以查找该邮政编码是否可以送货。

所以我们使用了这个扩展:product-delivery-check-by-zip-code magento 扩展

我们得到了这个扩展所需要的东西。但使用此扩展程序后,产品上的“添加到购物车”按钮

查看页面无法正常工作,产品图片也没有像以前那样缩放。

似乎这是在产品视图页面上显示的文件

app\design\frontend\default\default\template\techinflo\checkavailability\availability.phtml

availability.phtml 代码在这里:http://pastebin.com/YpuwTkFS

演示:http://demo1.kidsdial.com/index.php/electronics/24-widescreen-flat-panel-lcd-monitor.html

请帮我找到解决办法。

【问题讨论】:

    标签: magento


    【解决方案1】:

    恕我直言,此问题与可用性无关。 “添加到购物车”按钮调用一个 JS 方法来提交相应的表单。但是,您在该页面上有一些 JS 问题阻止了任何 JS 执行 - 可能是由于 jQuery 不兼容或其他原因。查看您的浏览器控制台以查看所有错误

    TypeError: jQuery(...).dcSocialShare is not a function intel-core-2-extreme-qx9775-3-20ghz-retail.html:727:0
    Use of getPreventDefault() is deprecated.  Use defaultPrevented instead. jquery-1.8.3.min.js:2:0
    TypeError: jQuery(...).viewPC is not a function em0113.js:372:5
    TypeError: jQuery(...).csslider is not a function intel-core-2-extreme-qx9775-3-20ghz-retail.html:486:0
    TypeError: jQuery.easing[jQuery.easing.def] is not a function jquery.themepunch.plugins.min.js:69:81
    TypeError: jQuery(...).ajaxForm is not a function em_ajaxcart.js:275:8

    并解决它们。这也应该恢复所有其他依赖于 JS 的功能,例如图像缩放。

    【讨论】:

    • 嗯,那是一个与原问题无关的问题。至于为什么你有 JS 问题,你必须调试你的整个设置。仅仅通过查看页面是不可行的。重要的是:由于其他 JS 问题,您的添加到购物车方法不起作用。它与 .phtml 文件无关。
    • 非常感谢,仅安装扩展程序后我面临这些问题。所以从该availability.phtml 文件中显示在产品视图页面中的唯一原因。因此,该文件中存在的 js 脚本可能是“添加到购物车”按钮的问题......但我仍然无法找到解决方案......
    【解决方案2】:

    在我的情况下,它通过取消勾选“合并 JavaScript 文件”(系统 > 配置 > 开发人员)得到解决

    【讨论】:

      【解决方案3】:

      执行以下操作

      web/unsecure/base_url
      web/secure/base_url
      From http://localhost/magento2community/
      to http://127.0.0.1/magento2community/
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-11-15
        • 2016-11-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-08-30
        • 2014-12-10
        相关资源
        最近更新 更多