\n\
');
var pos;
pos = $('#button-select-cart').offset();
$("#alert_success").css({ "left": (pos.left - 70) + "px", "top": (pos.top - 520) + "px" });
});
$('#button-cart').on('click', addToCart);
function addToCart() {
$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: $('input[type=radio]:checked, input[type=text], #product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'file\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea'),
dataType: 'json',
beforeSend: function() {
//$('#button-cart').button('loading');
},
complete: function() {
//$('#button-cart').button('reset');
},
success: function(json) {
$('.alert, .text-danger').remove();
$('.form-group').removeClass('has-error');
if (json['error']) {
if (json['error']['option']) {
for (i in json['error']['option']) {
var element = $('#input-option' + i.replace('_', '-'));
if (element.parent().hasClass('styled-select')) {
element.parent().after('
' + json['error']['option'][i] + '
');
} else if (element.parent().hasClass('input-group')) {
element.parent().after('
' + json['error']['option'][i] + '
');
} else {
element.after('
' + json['error']['option'][i] + '
');
}
}
}
if (json['error']['recurring']) {
$('select[name=\'recurring_id\']').after('
' + json['error']['recurring'] + '
');
}
// Highlight any found errors
$('.text-danger').parent().addClass('has-error');
}
if (json['success']) {
//alert(json['total']);
$('.breadcrumb').after('\
We use cookies to offer you the best experience on our site. By continuing to browse the site, You are agree to use cookies. For obtain more informations please click here.