IWD单页签出扩展插件Magento:查看刷新

IWD单页签出扩展插件Magento:查看刷新,magento,Magento,我想使用IWD的onepagecheckout(一步结帐)扩展,并将其与Phoenix的货到付款扩展一起使用 我修改了代码,使其正确显示货到付款费用,但在审阅部分中正确显示总成本需要3次加载时间。有没有办法美化它,使它只显示“加载”一次,并在背景中显示三次(否则费用将无法正确显示) 这就是我所做的: 我已将其添加到/template/onepagecheckout/onepagecheckout.phtml中的模板中: <script type="text/javascript" >

我想使用IWD的onepagecheckout(一步结帐)扩展,并将其与Phoenix的货到付款扩展一起使用

我修改了代码,使其正确显示货到付款费用,但在审阅部分中正确显示总成本需要3次加载时间。有没有办法美化它,使它只显示“加载”一次,并在背景中显示三次(否则费用将无法正确显示)

这就是我所做的:

我已将其添加到/template/onepagecheckout/onepagecheckout.phtml中的模板中:

 <script type="text/javascript" >
$j(function($) {
$j('input[name*="payment[method]"]').live('click', function() {
checkout.update2({
'review': 1,
'payment-method': 1
});
});
$j('input[name*="shipping_method"]').live('click', function() {
checkout.update({
'review': 1
,'payment-method': 1
});
setTimeout(function(){
checkout.update({
'review': 1,
});
}, 500);
});
});
</script> 
我补充说

     update2: function (params) {
if (this.loadWaiting != false) {
return
}
if (this.s_code == '') return this.opcdis();
var parameters = $(this.form).serialize(true);
for (var i in params) {
if (!params[i]) {
continue
}
var obj = $('checkout-' + i + '-load');
if (obj != null) {
var size = obj.getDimensions();
obj.setStyle({
'width': size.width + 'px',
'height': size.height + 'px'
}).update('').addClassName('loading');
parameters[i] = params[i]
}
}
checkout.setLoadWaiting(true);
var request = new Ajax.Request(this.updateUrl, {
method: 'post',
onSuccess: this.setResponse2.bind(this),
onFailure: this.ajaxFailure.bind(this),
parameters: parameters
})
},
setResponse2: function (response) {
response = response.responseText.evalJSON();
if (response.redirect) {
location.href = check_secure_url(response.redirect);
return true
}
checkout.setLoadWaiting(false);
if (response.order_created) {
$('onepagecheckout_orderform').action = this.successUrl;
$('opc_submit_form').click();
return true
} else if (response.error_messages) {
var msg = response.error_messages;
if (typeof (msg) == 'object') {
msg = msg.join("\n")
}
alert(msg)
}
$('review-please-wait').hide();
if (response.update_section) {
for (var i in response.update_section) {
ch_obj = $('checkout-' + i + '-load');
if (ch_obj != null) {
ch_obj.setStyle({
'width': 'auto',
'height': 'auto'
}).update(response.update_section[i]).setOpacity(1).removeClassName('loading');
if (i === 'shipping-method') {
shippingMethod.addObservers()
}
}
}
}
if (response.duplicateBillingInfo) {
shipping.syncWithBilling()
}
if (!response.reload_totals) {
checkout.update({
'review': 1
})
}
return false
}, 
我已经换了

 this.currentMethod = method; // This code was here before

this.currentMethod=method;//这个代码以前在这里
var shippingMethods=document.getElementsByName('shipping_方法');
if(shippingMethods.length!=0){
对于(var i=0;i
当发货方式更改时,付款部分会明显刷新两次,删除“货到付款”选项(这是正确的),并刷新“审核”部分三次,因此费用会以任意方式添加,或从“审核/总计”部分中删除


提前感谢

默认情况下,OPC更新文档加载审核:

window.onload = function () {
    checkout.update({
        'payment-method': 1,
        'shipping-method': 1,
        'review': 1
    })

并在每次更改配送方式时更新“review”部分,因此您添加了两个额外的checkout.update({“…”})

我需要这些刷新时间来正确更新review部分,但是我如何在后台进行多次刷新,以及仅为查看者/客户“加载”一次?我认为这与real_update函数和这一行有关:`}).update('''.addClassName('loading');`但我不知道如何正确添加刷新。
this.currentMethod = method; // This code was here before
var shippingMethods = document.getElementsByName('shipping_method');
if (shippingMethods.length != 0) {
for (var i = 0; i < shippingMethods.length; i++) {
if (shippingMethods[i].checked) {
checkout.update({'review': 1});
}
}
} 
window.onload = function () {
    checkout.update({
        'payment-method': 1,
        'shipping-method': 1,
        'review': 1
    })