text: function priceCount(){var t=$(".add-to-cart").attr("data-id"),a=$(".count-add-to-cart").val();$.ajax({type:"POST",url:"/shop/cart/price-count",data:{product_id:t,count:a,_csrf:$("meta[name=csrf-token]").attr("content")},success:function(t){$(".total-cost").html(t)}})}$(document).ready(function(){$(document).on("click",".add-to-cart",function(){var t=$(this).data("id"),a=$(this).attr("shop-id"),e=$(".count-add-to-cart").val();return $.ajax({type:"POST",url:"/shop/cart/add-in-cart",data:{product_id:t,count:e,shop_id:a,_csrf:$("meta[name=csrf-token]").attr("content")},success:function(t){var a=JSON.parse(t);$(".basket-counter").html(a.cartCount),$(".modal-count-cart").html(a.cartCount),$("#modal_close").after(a.cart)}}),!1}),$(document).on("click",".delete-product-cart",function(){var t=$(this).attr("product-id"),a=$(this).attr("shop-id");return $.ajax({type:"POST",url:"/shop/cart/delete-from-cart",data:{product_id:t,shop_id:a,_csrf:$("meta[name=csrf-token]").attr("content")},success:function(t){console.log(t)}}),!1}),$(document).on("click",".update-count-cart",function(){var t,a=$(this).attr("product-id"),e=$(this).attr("shop-id");setTimeout(function(){t=$("#js-product-quantity"+a).val(),$.ajax({type:"POST",url:"/shop/cart/set-count",data:{product_id:a,shop_id:e,count:t,_csrf:$("meta[name=csrf-token]").attr("content")},success:function(t){$(".shop__content").html(t)}})},100)}),$(document).on("click",".update-count",function(){setTimeout(function(){priceCount()},1e3)}),$(".update-count").on("click",function(){setTimeout(function(){priceCount()},100)}),$(document).on("change",".count-add-to-cart",function(){priceCount()}),$(".add-product-like").on("click",function(){var t=$(this),a=t.data("id");return $.ajax({type:"POST",url:"/shop/shop/like",data:{product_id:a,_csrf:$("meta[name=csrf-token]").attr("content")},success:function(a){1==a?t.addClass("active"):t.removeClass("active")}}),!1}),$("#input-1-xs").on("rating:change",function(t,a,e){$("#productsreviews-rating").val(a)}),$(document).on("submit","#addReviewsProducts",function(){return $.pjax.reload({container:".single-shop__tab-item",url:"/ajax/ajax/add-reviews-products",data:$(this).serialize(),replace:!1,timeout:1e4}),!1}),$("#addReviewsProducts").on("beforeSubmit",function(){var t=$(this).serialize();return $.ajax({url:"/ajax/ajax/add-reviews-products",type:"POST",data:t,success:function(t){$("#addReviewsProducts").html(t)},error:function(){alert("Error!")}}),!1}),$("input").is("#input-2-xs")&&$("#input-1-xs").rating({theme:"",language:"ru",stars:5,filledStar:'<i class="fa fa-star fa-fw"></i>',emptyStar:'<i class="fa fa-star fa-fw"></i>',containerClass:"",size:"xs",animate:!0,displayOnly:!1,rtl:!1,showClear:0,showCaption:!0,starCaptionClasses:{1:"label label-danger badge-danger",2:"label label-warning badge-warning",3:"label label-info badge-info",4:"label label-primary badge-primary",5:"label label-success badge-success"},clearButton:'<i class="glyphicon glyphicon-minus-sign"></i>',clearButtonBaseClass:"clear-rating",clearButtonActiveClass:"clear-rating-active",clearCaptionClass:"label label-default",clearValue:null,captionElement:null,clearElement:null,hoverEnabled:!0,hoverChangeCaption:!0,hoverChangeStars:!0,hoverOnClear:!0,zeroAsNull:!0,defaultCaption:"Stars {rating}",starCaptions:{1:"1",2:"2",3:"3",4:"4",5:"5"},clearCaption:"Нет оценки"}),$("input").is("#input-2-xs")&&$("#input-2-xs").rating({theme:"",language:"ru",stars:5,filledStar:'<i class="fa fa-star fa-fw"></i>',emptyStar:'<i class="fa fa-star fa-fw"></i>',containerClass:"",size:"xs",animate:!0,displayOnly:1,rtl:!1,showClear:0,showCaption:0,hoverEnabled:0,hoverChangeCaption:!0,hoverChangeStars:!0,hoverOnClear:!0,zeroAsNull:!0,defaultCaption:"Stars {rating}",step:"0.1"})});