'); } else { element.after('
' + json['error']['product_option'][i] + '
'); } } if (json['error']['option']) { for (i in json['error']['option']) { var element = $('#input-option' + i.replace('_', '-')); 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']) { //$('.breadcrumb').after('
' + json['success'] + '
'); $('#cart > button').html(' ' + json['total']); var time; $.magnificPopup.open({ showCloseBtn: false, items: { src:'

' + json['success'] + '

' + json['buttons'] + '
' }, callbacks:{ open: function(){ time = setTimeout(function(){$.magnificPopup.close()},5000); }, afterClose: function(){ clearTimeout(time); } } }); $('#cart-total').html(json['total']); //$('html, body').animate({ scrollTop: 0 }, 'slow'); $('#cart > ul').load('index.php?route=common/cart/info ul li'); } }, error: function(xhr, ajaxOptions, thrownError) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); } }); }); //-->