Ok, oto prawdziwa poprawka, którą wymyśliłem.
Edytuj /skin/frontend/base/default/js/opcheckout.js
i edytuj setMethod()
metodę, zastępując:
setMethod: function(){
if ($('login:guest') && $('login:guest').checked) {
this.method = 'guest';
new Ajax.Request(
this.saveMethodUrl,
{method: 'post', onFailure: this.ajaxFailure.bind(this), parameters: {method:'guest'}}
);
Element.hide('register-customer-password');
this.gotoSection('billing', true);
}
else if($('login:register') && ($('login:register').checked || $('login:register').type == 'hidden')) {
this.method = 'register';
new Ajax.Request(
this.saveMethodUrl,
{method: 'post', onFailure: this.ajaxFailure.bind(this), parameters: {method:'register'}}
);
Element.show('register-customer-password');
this.gotoSection('billing', true);
}
else{
alert(Translator.translate('Please choose to register or to checkout as a guest').stripTags());
return false;
}
document.body.fire('login:setMethod', {method : this.method});
},
Z:
setMethod: function(){
var formKey = $('checkout-step-login').select('[name=form_key]')[0].value;
if ($('login:guest') && $('login:guest').checked) {
this.method = 'guest';
new Ajax.Request(
this.saveMethodUrl,
{method: 'post', onFailure: this.ajaxFailure.bind(this), parameters: {method:'guest', form_key:formKey}}
);
Element.hide('register-customer-password');
this.gotoSection('billing', true);
}
else if($('login:register') && ($('login:register').checked || $('login:register').type == 'hidden')) {
this.method = 'register';
new Ajax.Request(
this.saveMethodUrl,
{method: 'post', onFailure: this.ajaxFailure.bind(this), parameters: {method:'register', form_key:formKey}}
);
Element.show('register-customer-password');
this.gotoSection('billing', true);
}
else{
alert(Translator.translate('Please choose to register or to checkout as a guest').stripTags());
return false;
}
document.body.fire('login:setMethod', {method : this.method});
},
To zrobi, gdy będziemy czekać na wersję v2 łatki