Subversion Repositories SmartDukaan

Rev

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

Rev 15722 Rev 15767
Line 108... Line 108...
108
						ga('send', 'event', 'liveprice', 'outofstock', $('#bestpriceproductname').html());
108
						ga('send', 'event', 'liveprice', 'outofstock', $('#bestpriceproductname').html());
109
						var properties = {};
109
						var properties = {};
110
						properties.sku = String(response.products[0]._id);
110
						properties.sku = String(response.products[0]._id);
111
						properties.source = String(response.products[0].source_id);
111
						properties.source = String(response.products[0].source_id);
112
						properties.product_name = String($('#bestpriceproductname').html());
112
						properties.product_name = String($('#bestpriceproductname').html());
113
						pma.send('products','livescore','outofstock',me,properties);
113
						pma.send('products','liveprice','outofstock',me,properties);
114
						outOfStockCount++;
114
						outOfStockCount++;
115
						$(that).parent().parent().remove();	
115
						$(that).parent().parent().remove();	
116
					}
116
					}
117
					if(!response.products[0].available_price){
117
					if(!response.products[0].available_price){
118
						// outOfStockCount++;
118
						// outOfStockCount++;
Line 217... Line 217...
217
		});
217
		});
218
		ga('send', 'event', 'preferences', 'update', me);
218
		ga('send', 'event', 'preferences', 'update', me);
219
		properties = pma.formDataToObject($('#categorypreference-'+$(this).data('id')).serializeArray());
219
		properties = pma.formDataToObject($('#categorypreference-'+$(this).data('id')).serializeArray());
220
		pma.send('preferences', 'update', 'set', me, properties);
220
		pma.send('preferences', 'update', 'set', me, properties);
221
	});
221
	});
222
	$(document).on('click','.viewproduct',function(e){
222
	$(document).on('click','.viewproduct',function(e){		
223
		if(typeof livePriceCalls != undefined) {
223
		if(typeof livePriceCalls != undefined) {
224
	    	for(var i in livePriceCalls){
224
	    	for(var i in livePriceCalls){
225
	    		livePriceCalls[i].abort();
225
	    		livePriceCalls[i].abort();
226
	    	}
226
	    	}
227
	    }
227
	    }
Line 243... Line 243...
243
				format: "json"
243
				format: "json"
244
			},
244
			},
245
			// Work with the response
245
			// Work with the response
246
			success: function( response ) {
246
			success: function( response ) {
247
				if(response.success && response.type=='redirect'){
247
				if(response.success && response.type=='redirect'){
248
					if(store == 1) {
248
					if(store == 1 ) {
249
						document.location = '/r.html?'+Base64.encode(response.url);
249
						document.location = '/r.html?'+Base64.encode(response.url);
250
					} else if (store == 3 || store == 2) {
250
					} else if (store == 3 || store == 2) {
251
						if (store == 2){
251
						if (store == 2){
252
							response.url = 'http://mobilehotindia.com/r.html?'+Base64.encode(response.url);
252
							response.url = 'http://mobilehotindia.com/r.html?'+Base64.encode(response.url);
253
						}
253
						}
Line 822... Line 822...
822
}
822
}
823
 
823
 
824
 
824
 
825
var pma = new function() {
825
var pma = new function() {
826
    this.apiurl = "http://45.33.50.227:8081/";
826
    this.apiurl = "http://45.33.50.227:8081/";
827
    // this.apiurl = "http://127.0.0.1:8081/";
-
 
828
    this.endpoints = {'identify':'identify','profile':'profile','track':'track'};
827
    this.endpoints = {'identify':'identify','profile':'profile','track':'track'};
829
 
828
 
830
    this.send = function (category,action,label,user_id,properties) {
829
    this.send = function (category,action,label,user_id,properties) {
831
    	if(!properties){
830
    	if(!properties){
832
    		properties = {};
831
    		properties = {};