I've added a custom block to the payment step of the onepage checkout. I need to modify something in the cart without the onepage process being interrupted or anything refreshing/redirecting.
I added a form and button above the payment methods, which calls this function onclick :
function submitPartial(){
//console.log("worked");
var url = '<?php echo Mage::getUrl('',array('_secure'=>true)).'checkout/cart/index' ?>';
var data = jQuery('#wholecart_partialpayment_form').serialize();
jQuery.ajax({
type: "POST",
url: url,
data: data,
complete: function(data){
return false;
}
});
}
And this works, If I open the cart page it's been updated, but if I then try to continue the onepage process by clicking "continue" the console throws a
Failed to load resource: the server responded with a status of 403 (Forbidden) : /index.php/checkout/onepage/savePayment/
If I don't click on my button and do my custom ajax request, the onepage process works normally.
I'm assuming my ajax call interrupts something in the form submitting of the onepage checkout, maybe it requires some kind of validation and my ajax call breaks it (hence the 403)? I'm honestly a bit lost, the onepage is pretty complicated.