Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
The button has a form handler that sends a request to the third-party "quick_order" module. The handler function is below:
function add_quick_order() {
$.ajax({
url: 'index.php?route=module/quick_order/add_order',
type: 'post',
data: $('.quick_order input, .quick_order textarea').serialize(),
dataType: 'json',
success: function(json) {
if (json['success']) {
$('.quick_order').removeClass('show');
$('#cart').load('index.php?route=common/cart/info #cart > *');
$('.cart_content').load('index.php?route=common/cart/info .cart_content > *', function() {
$('.cart_content .empty').css('display', 'none').delay(5000).fadeIn();
$('.quick_order').after($('<div class="quick_order_success">'+json['success']+'</div>').fadeIn().delay(4000).fadeOut());
});
}
if (json['error']) {
$('.quick_order_button').before($('<div class="quick_order_warning">'+json['error']+'</div>').fadeIn().delay(3000).fadeOut());
}
}
});
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question