('
' + 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'); try { $('html, body').animate({ scrollTop: $('.form-group.has-error').offset().top - 50 }, 'slow'); } catch (e) { } } if (json['success']) { if ($('html').hasClass('popup-options')) { parent.$(".popup-options .popup-close").trigger('click'); } if (json['notification']) { parent.show_notification(json['notification']); } else { parent.$('#content').parent().before('
' + json['success'] + '
'); } parent.$('#cart-total').html(json['total']); parent.$('#cart-items').html(json['items_count']); if (json['items_count']) { parent.$('#cart-items').removeClass('count-zero'); } else { parent.$('#cart-items').addClass('count-zero'); } if (Journal['scrollToTop']) { parent.$('html, body').animate({ scrollTop: 0 }, 'slow'); } parent.$('.cart-content ul').load('index.php?route=common/cart/info ul li'); if (window.location.href.indexOf('quick_buy=true') !== -1) { parent.location.href = Journal['checkoutUrl']; } if ($btn.data('quick-buy') !== undefined) { location = Journal['checkoutUrl']; } if (parent.window['_QuickCheckout']) { parent.window['_QuickCheckout'].save(); } } }, error: function (xhr, ajaxOptions, thrownError) { alert(thrownError + '\r\n' + xhr.statusText + '\r\n' + xhr.responseText); } }); }); //-->