是的,我已经看到了关于这个问题的其他主题,但我还不能解决这个问题。所以我希望你能帮助我。在我的 Magento 商店www.koekentrommel.nl中,问题很简单,添加到购物车按钮不起作用。我是 jquery 新手,但我尝试了 noconflict-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>