Custom Order
product title...
').html(data.redirect_url).text();
return;
}
var successText = data.success_text;
$(blockId + '_sending_data').hide();
$(blockId + '_submit_button').enable();
$(blockId).reset();
if (typeof DROPZONE !== "undefined") {
if (typeof DROPZONE._WVJa3A !== "undefined") {
for (var i = 0; i < DROPZONE._WVJa3A.length; i++) {
DROPZONE._WVJa3A[i].reset();
}
}
}
swal.fire({
title: 'Success!',
html: successText,
type: 'success'
});
} else {
$(blockId + '_submit_button').enable();
if ($(blockId + '_sending_data'))
$(blockId + '_sending_data').hide();
if ($(blockId + '_submit_button'))
$(blockId + '_submit_button').enable();
var errorTxt = '';
if (data.errors && typeof (data.errors) == "string") {
errorTxt = data.errors.unescapeHTML();
} else {
errorTxt = 'Unknown error(s) occured';
}
swal.fire({
title: 'Error',
html: errorTxt,
type: 'error'
});
if (data.script) {
eval(data.script);
}
}
},
error: function (xhr, status, errorThrown) {
console.log('Error happens. Try again.');
console.log(errorThrown);
}
});
});
});
});