Subversion Repositories SmartDukaan

Rev

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

Rev 17766 Rev 17885
Line 26... Line 26...
26
		<script type="text/javascript">
26
		<script type="text/javascript">
27
			var me = '<?php echo $logged_user['id'];?>';
27
			var me = '<?php echo $logged_user['id'];?>';
28
			var apihost = '<?php echo $apihost;?>';
28
			var apihost = '<?php echo $apihost;?>';
29
			var ip = '<?php echo $_SERVER['HTTP_CF_CONNECTING_IP'];?>';
29
			var ip = '<?php echo $_SERVER['HTTP_CF_CONNECTING_IP'];?>';
30
		</script>
30
		</script>
-
 
31
		<script type="text/javascript">
-
 
32
			function getC(name)
-
 
33
			  {
-
 
34
			    var re = new RegExp(name + "=([^;]+)");
-
 
35
			    var value = re.exec(document.cookie);
-
 
36
			    return (value != null) ? unescape(value[1]) : null;
-
 
37
			}
-
 
38
			var value = getC('txn_comp');
-
 
39
			if(typeof(value) !== 'undefined' && value!==null ){
-
 
40
				if(value=='no'){
-
 
41
				<?php if(isset($localCartHistory)):?>
-
 
42
					var data = '<?php echo json_encode($localCartHistory);?>';
-
 
43
					data = JSON.parse(data);
-
 
44
					var totalCartValue = data.totalAmount;
-
 
45
					var totalCartQuantity = 0;
-
 
46
					var cartItems = {};
-
 
47
					var jsonObjToBeStored = {};
-
 
48
					var shippingCharges = data.shippingCharge;
-
 
49
					var totalSkus = 0;
-
 
50
	
-
 
51
					for (var i = 0; i < data.cartItems.length; i++) {
-
 
52
						if(data.cartItems[i].quantity>0){
-
 
53
						    var itemDetail = {};
-
 
54
						    itemDetail['quantity'] = data.cartItems[i].quantity;
-
 
55
						    itemDetail['unitprice'] = data.cartItems[i].sellingPrice;
-
 
56
						    itemDetail['productname'] = data.cartItems[i].title;
-
 
57
						    itemDetail['brand'] = data.cartItems[i].brand;
-
 
58
						    totalSkus = totalSkus+1;
-
 
59
						    totalCartQuantity = totalCartQuantity + data.cartItems[i].quantity;
-
 
60
						    cartItems[data.cartItems[i].itemId] = itemDetail;
-
 
61
						}
-
 
62
					}
-
 
63
					jsonObjToBeStored['totalCartValue'] = totalCartValue;
-
 
64
					jsonObjToBeStored['totalCartQuantity'] = totalCartQuantity;
-
 
65
					jsonObjToBeStored['totalSkus'] = totalSkus;
-
 
66
					jsonObjToBeStored['shippingCharges'] = shippingCharges;
-
 
67
					jsonObjToBeStored['cartItems'] = cartItems;
-
 
68
					localStorage.setItem('cart_details',JSON.stringify(jsonObjToBeStored));
-
 
69
				<?php endif;?>
-
 
70
					document.cookie = 'txn_comp=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
-
 
71
				}
-
 
72
				if(value=='yes'){
-
 
73
					localStorage.removeItem('cart_details');
-
 
74
					document.cookie = 'txn_comp=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
-
 
75
				}
-
 
76
			}
-
 
77
		</script>
31
	</head>
78
	</head>
32
	<body>		
79
	<body>		
33
		<div id="fb-root"></div>
80
		<div id="fb-root"></div>
34
<script>(function(d, s, id) {
81
<script>(function(d, s, id) {
35
  var js, fjs = d.getElementsByTagName(s)[0];
82
  var js, fjs = d.getElementsByTagName(s)[0];