// //
$.each(["i3-cart-add","i3-cart-increase","i3-cart-remove","i3-cart-decrease","i3-cart-set"],function(index,value) {i3.defaults.components[value]={callback:function(response) {if($("#i3-cart-header").length>0) i3.ajax({url:"/cart/get_header/",dataType:"json",success:function(response) {if(response.error) return i3.alert(response.error);i3("#i3-cart-header").html(response.data).inherit();}});if(value=="i3-cart-add") {if(response.error) return i3.alert(response.error);var block=i3.jsonResponse(response.data);var cart=i3(".i3-cart-mini");cart.html(block.html);cart.addClass('--active');window.setTimeout(function(){cart.removeClass('--active');},8000);}}}});