Subversion Repositories SmartDukaan

Rev

Rev 1035 | Rev 1190 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1035 Rev 1048
Line 37... Line 37...
37
  });
37
  });
38
}); 
38
}); 
39
 
39
 
40
function changeQty(obj,itempriceID,totalPriceID) {
40
function changeQty(obj,itempriceID,totalPriceID) {
41
  var prodID = $(obj).parent().parent().parent().parent().parent().parent().children().find("span.pro").attr("id");
41
  var prodID = $(obj).parent().parent().parent().parent().parent().parent().children().find("span.pro").attr("id");
42
  var quantity = parseInt(obj.value)
42
  var quantity = parseInt(obj.value);
43
  //alert("AJAX request to change product quantity in Cart. Product ID: " + prodID + " quantity: " + quantity);
43
  //alert("AJAX request to change product quantity in Cart. Product ID: " + prodID + " quantity: " + quantity);
44
		
44
		
45
  jQuery.ajax({
45
  jQuery.ajax({
46
    type: "POST",
46
    type: "POST",
47
    url: "/cart/" + prodID + "?_method=put&productid="+prodID+ "&quantity="+quantity,
47
    url: "/cart/" + prodID + "?_method=put&productid="+prodID+ "&quantity="+quantity,
Line 75... Line 75...
75
}
75
}
76
 
76
 
77
function sumOfColumns(tableID, columnIndex, hasHeader) {
77
function sumOfColumns(tableID, columnIndex, hasHeader) {
78
  var tot = 0;
78
  var tot = 0;
79
  var inc=1;
79
  var inc=1;
80
  $("#" + tableID + " tr" + (hasHeader ? ":gt(0)" : ""))
80
  var tableElement = $("#" + tableID + " tr" + (hasHeader ? ":gt(0)" : ""));
81
  .children("td:nth-child(" + columnIndex + ")")
81
  var tableChildren = tableElement.children("td:nth-child(" + columnIndex + ")");
82
  .each(function() {
82
  tableChildren.each(function() {
83
    var currentVal=document.getElementById('totalPrice'+inc).innerHTML;
83
    var currentVal=document.getElementById('totalPrice'+inc).innerHTML;
84
    inc++;
84
    inc++;
85
    var splitVal=currentVal.split("Rs.");
85
    var splitVal=currentVal.split("Rs.");
86
    var num = parseFloat(splitVal[1].replace(/[^\d\.-]/g,''));
86
    var num = parseFloat(splitVal[1].replace(/[^\d\.-]/g,''));
87
    tot += parseFloat(num);
87
    tot += parseFloat(num);
Line 125... Line 125...
125
      var itemId = $(obj).parent().parent().find("span.pro").attr("id");
125
      var itemId = $(obj).parent().parent().find("span.pro").attr("id");
126
      //	alert("item id is  " + itemId);
126
      //	alert("item id is  " + itemId);
127
      if(itemId == null){
127
      if(itemId == null){
128
        break;
128
        break;
129
      }
129
      }
130
      changeEstimate(itemId)
130
      changeEstimate(itemId);
131
    }
131
    }
132
  }else{
132
  }else{
133
    jQuery.ajax({
133
    jQuery.ajax({
134
      type: "GET",
134
      type: "GET",
135
      url: "/estimate/"+$("#zipcode").val()+"_"+item_id,
135
      url: "/estimate/"+$("#zipcode").val()+"_"+item_id,