简体   繁体   English

Magento添加到购物车按钮不起作用

[英]Magento add to cart button not working

Yes, I've seen the other topics about this problem, but I couldn't solve the problem yet. 是的,我已经看过有关此问题的其他主题,但是我还不能解决问题。 So I do hope you can help me. 所以我希望你能帮助我。 The problem is simple in my Magento shop www.koekentrommel.nl the add to cart button doesn't work. 在我的Magento商店www.koekentrommel.nl中 ,问题很简单,“添加到购物车”按钮不起作用。 I'm a jquery newbie but I've tried the noconflict-code, but with no result. 我是一名jQuery新手,但是我尝试了noconflict代码,但没有结果。 Can you please help? 你能帮忙吗? A shop without add to cart is as a car without tires... Thanks a lot! 没有添加购物车的商店就像没有轮胎的汽车一样……非常感谢!

This is the view.phtml code: 这是view.phtml代码:

<?php $_helper = $this->helper('catalog/output'); ?>
<?php $_product = $this->getProduct(); ?>

<script type="text/javascript">
var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
$.noConflict();
</script>

    }.bind(productAddToCartForm);

    productAddToCartForm.submitLight = function(button, url){
        if(this.validator) {
            var nv = Validation.methods;
            delete Validation.methods['required-entry'];
            delete Validation.methods['validate-one-required'];
            delete Validation.methods['validate-one-required-by-name'];
            // Remove custom datetime validators
            for (var methodName in Validation.methods) {
                if (methodName.match(/^validate-datetime-.*/i)) {
                    delete Validation.methods[methodName];
                }
            }

            if (this.validator.validate()) {
                if (url) {
                    this.form.action = url;
                }
                this.form.submit();
            }
            Object.extend(Validation.methods, nv);
        }
    }.bind(productAddToCartForm);
//]]>
</script>


Clearly your jQuery is conflicting with prototype. 显然,您的jQuery与原型冲突。 NoConflcit should have resolved it NoConflcit应该已经解决了

You have 2 closing script tags, you need to delete the one after $.noConflict(); 您有2个关闭脚本标签,需要删除$ .noConflict()之后的标签;

 <script type="text/javascript">
   $.noConflict();
 </script>  <-- Delete

  }.bind(productAddToCartForm);
   .....
 </script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM