eDaddi
Active member
EDIT: Moved to proper forum
On my dev site I have a template with two forms and JS. The second form does a redirect after the form submits and some ajax stuff happens
Everything works as it should ..... in dev.
When I push it to live the form submits and the page refreshes, for the life of my I can't get it to do the redirect.
The backend does what it's supposed to. I get no errors.
if I throw a alert(parts['cartUrl']); in before the redirect it's getting the data it should.
Exact same template, JS and PHP code in dev & live
On my dev site I have a template with two forms and JS. The second form does a redirect after the form submits and some ajax stuff happens
Code:
$(document).on('ajax:complete', function(event, xhr, settings){
var parts = jQuery.parseJSON(xhr.responseText);
if(parts['status'] != 'ok'){
if('cartUrl' in parts){
window.location.href = '/store/cart.php?target=cart&action=add&product_id='+parts['cartUrl'];
Everything works as it should ..... in dev.
When I push it to live the form submits and the page refreshes, for the life of my I can't get it to do the redirect.
The backend does what it's supposed to. I get no errors.
if I throw a alert(parts['cartUrl']); in before the redirect it's getting the data it should.
Exact same template, JS and PHP code in dev & live