Subversion Repositories SmartDukaan

Rev

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

Rev 1190 Rev 1460
Line 40... Line 40...
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
	if (quantity > 5)	{
-
 
46
		alert("You can not order more than 5 pieces of same product.");
-
 
47
		$(obj).focus();
-
 
48
	}
-
 
49
	else	{
45
	jQuery.ajax({
50
		jQuery.ajax({
46
		type: "POST",
51
			type: "POST",
47
		url: "/cart/" + prodID + "?_method=put&productid=" + prodID + "&quantity=" + quantity,
52
			url: "/cart/" + prodID + "?_method=put&productid=" + prodID + "&quantity=" + quantity,
48
		data: "productid=" + prodID + "&quantity=" + quantity,
53
			data: "productid=" + prodID + "&quantity=" + quantity,
49
		success: function(msg){
54
			success: function(msg){
50
/*			if(msg == 1)	{
55
	/*			if(msg == 1)	{
51
				//   	alert( "Quantity Updates for the item" );
56
					//   	alert( "Quantity Updates for the item" );
52
			} else	{
57
				} else	{
53
				// 	alert( "Not able to update the quantity for the item" );
58
					// 	alert( "Not able to update the quantity for the item" );
54
				return;
59
					return;
55
			}*/
60
				}*/
56
			window.location.reload();
61
				window.location.reload();
57
		}
62
			}
58
	});
63
		});
-
 
64
	}
-
 
65
	
59
 
66
 
60
//	var val=document.getElementById(itempriceID).value;
67
//	var val=document.getElementById(itempriceID).value;
61
//	var num = parseFloat(val.replace(/[^\d\.-]/g,''));
68
//	var num = parseFloat(val.replace(/[^\d\.-]/g,''));
62
//	var qty=parseInt(obj.value);
69
//	var qty=parseInt(obj.value);
63
//	var totalVal1=num*qty;
70
//	var totalVal1=num*qty;