Guest User

Untitled

a guest
Apr 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function(){
  2.    //функция обновления суммы
  3.  
  4.    function updateSum(id) {
  5.       //переменные
  6.       var count = $(".summ").find("input#count_"+id).val(); //кол-во товара
  7.       var opts = {
  8.          symbol: "руб.",
  9.          format: "%v %s",
  10.          thousand: " ",
  11.          decimal: ","
  12.       }; //валюты
  13.       //Цена товара
  14.  
  15.       for( var i = 0; i != 9; i++ ) {
  16.          var price = $(".price_type").find("span#iprice"+i+"_"+id).attr("alt");
  17.          $(".price_type").find('span#rprice'+i+'_'+id).text(accounting.formatMoney(parseInt(price)*count, opts));
  18.       }
  19.  
  20.  
  21.    
  22.    }
  23.  
  24.    //Клики по кнопкам
  25.    $(this).find('input.plus').bind('click', function(){
  26.       updateSum($(this).attr("id"));
  27.    });
  28.    
  29.    $(this).find('input.minus').bind('click', function(){
  30.       updateSum($(this).attr("id"));
  31.    
  32.    });
  33.  
  34.  
  35.  
  36. });
Add Comment
Please, Sign In to add comment