Yes you get erorr is right !
you mean you add an input in step payment (same comment) on checkout page ?
if right !
please check file :catalog/view/theme/default/template/checkout/checkout.tpl (line 902)
when you click continue button in payment methol step : the code with this action:
Code: Select all
$('#button-payment').live('click', function() {
$.ajax({
url: 'index.php?route=checkout/payment',
type: 'post',
data: $('#payment-method input[type=\'radio\']:checked, #payment-method input[type=\'checkbox\']:checked, #payment-method textarea'),
dataType: 'json',
beforeSend: function() {
$('#button-payment').attr('disabled', true);
$('#button-payment').after('<span class="wait"> <img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');
},
complete: function() {
$('#button-payment').attr('disabled', false);
$('.wait').remove();
},
success: function(json) {
$('.warning').remove();
if (json['redirect']) {
location = json['redirect'];
}
if (json['error']) {
if (json['error']['warning']) {
$('#payment-method .checkout-content').prepend('<div class="warning" style="display: none;">' + json['error']['warning'] + '</div>');
$('.warning').fadeIn('slow');
}
} else {
$.ajax({
url: 'index.php?route=checkout/confirm',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}
if (json['output']) {
$('#confirm .checkout-content').html(json['output']);
$('#payment-method .checkout-content').slideUp('slow');
$('#confirm .checkout-content').slideDown('slow');
$('#payment-method .checkout-heading a').remove();
$('#payment-method .checkout-heading').append('<a><?php echo $text_modify; ?></a>');
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError);
}
});
}
}
});
});
see the code with this ajax:
Code: Select all
data: $('#payment-method input[type=\'radio\']:checked, #payment-method input[type=\'checkbox\']:checked, #payment-method textarea'),
you must add more element for the input post data
//post data to payment
ex:
Code: Select all
data: $('#payment-method input[type=\'radio\']:checked, #payment-method input[type=\'checkbox\']:checked, #payment-method textarea,#payment-method input[name=\'salutation\']'),
openfile :
catalog\controller\checkout\payment.php
find (line 48)
Code: Select all
$this->session->data['comment'] = strip_tags($this->request->post['comment']);
add
//get salution value
Code: Select all
$this->session->data['salutation'] = strip_tags($this->request->post['salutation']);
openfile catalog\controller\checkout\confirm.php
find :
Code: Select all
$data['comment'] = $this->session->data['comment'];
add
//get salution when complete payment
find :
Code: Select all
$data['salutation'] = $this->session->data['salutation'];
Note :
and do step add in model :
try agian !