Magento - 购物车删除项目无效

时间:2016-08-19 18:02:50

标签: php jquery ajax magento

我在最新版本1.9.2.4更新了我的商店,并且我有ssl启用,此后我的购物车中的删除按钮已停止工作。我在firebug中看到了这个错误:

ReferenceError: coShippingMethodForm is not defined
coShippingMethodForm.submit = function () { at line 655

在那一行,我有这个功能:

function getQuote() {
    $jq('#shipping-zip-form').attr('id','shipping-zip-form-ajax');
    var coShippingMethodFormAjax = new VarienForm('shipping-zip-form-ajax');

    **THIS IS THE LINE 655**  coShippingMethodForm.submit = function () {

        var country = $F('country');
        var optionalZip = false;

        for (i=0; i < countriesWithOptionalZip.length; i++) {
            if (countriesWithOptionalZip[i] == country) {
                optionalZip = true;
            }
        }
        if (optionalZip) {
            $('postcode').removeClassName('required-entry');
        }
        else {
            $('postcode').addClassName('required-entry');
        }
        if (this.validator.validate()) {
            this.form.submit();
        }
        console.log(countriesWithOptionalZip.length);
    }.bind(coShippingMethodFormAjax);
}

我怎么解决这个问题?

谢谢

1 个答案:

答案 0 :(得分:1)

这是您上面显示的代码:

var coShippingMethodFormAjax = new VarienForm('shipping-zip-form-ajax');

更新第655行

coShippingMethodForm.submit = function () {

coShippingMethodFormAjax .submit = function () {
相关问题