Basket on jquery add elements and to summarize it seems to do a minus from the sum, how to do?

$(".btn-designer").on("click",function(){
 var price_end = $(".designer-tovar-info").find("h1").find("span").html(); // Amount of product

 $(".basket-up").find("span").html(parseFloat(price_end) + parseFloat($(".basket-up").find("span").html())); // total amount of product
 $(".sum").find("h2").find("span").html($(".basket-up").find("span").html()); // total amount of product in the basket

$('.close-designer').hover(function(){
 var idLi = $(this).attr('data-close');
$('.close-designer-'+idLi).click(function(){
 var price_tovar = $('.designer-product-price').find('h1').find('span').attr('data-end');
 var end_basket = $(".basket-up").find("span").html();

 result_basket = parseFloat(end_basket) - parseFloat(price_tovar);
console.log(price_tovar);
$(".basket-up").find("span").html(result_basket);
})
});
 });

An example of the layout option to view https://studio-m-arts.ru/
March 20th 20 at 11:53
0 answer

Find more questions by tags jQuery