Subversion Repositories SmartDukaan

Rev

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

Rev 12091 Rev 12626
Line 152... Line 152...
152
	$('#computeShippingEstimate').click(function(){
152
	$('#computeShippingEstimate').click(function(){
153
		updateEstimate(getSeletectedItemId());
153
		updateEstimate(getSeletectedItemId());
154
	});
154
	});
155
	
155
	
156
    $("#addToCart").click(function(){
156
    $("#addToCart").click(function(){
-
 
157
    	if($(this).attr("href")!=undefined){
-
 
158
    		return true;
-
 
159
    	}
157
    	jQuery.ajax({
160
    	jQuery.ajax({
158
			type: "POST",
161
			type: "POST",
159
			url: "/addtocart",
162
			url: "/addtocart",
160
			data: "productid=" + getSeletectedItemId(),
163
			data: "productid=" + getSeletectedItemId(),
161
			success: function(msg)	{
164
			success: function(msg)	{
Line 366... Line 369...
366
		    }
369
		    }
367
		});
370
		});
368
	}
371
	}
369
}
372
}
370
function onColorSelectorChange(itemid){
373
function onColorSelectorChange(itemid){
-
 
374
	$('div.shipping1').remove();
-
 
375
	$('div.shipping').show();
-
 
376
	$('#addToCart').removeAttr("href");
371
	if(typeof privateDeals[itemid]== "undefined") {
377
	if(typeof privateDeals[itemid]== "undefined") {
372
		sellingPrice = Number(PARAMETERS[itemid].SP); 
378
		sellingPrice = Number(PARAMETERS[itemid].SP); 
373
		if($('#sp').length>0){
379
		if($('#sp').length>0){
374
			$('#sp').html(PARAMETERS[itemid].SP);
380
			$('#sp').html(PARAMETERS[itemid].SP);
375
			$('#mrp').html(PARAMETERS[itemid].MRP);
381
			$('#mrp').html(PARAMETERS[itemid].MRP);
376
			$('#saving').html(PARAMETERS[itemid].SAVING);
382
			$('#saving').html(PARAMETERS[itemid].SAVING);
377
			$("#item_id").val(itemid);
383
			$("#item_id").val(itemid);
-
 
384
			var exclusiveAffiliateItem;
-
 
385
			if(typeof ExclusiveAffItems != "undefined"){
-
 
386
			 	for(i in ExclusiveAffItems){
-
 
387
			 		if (ExclusiveAffItems[i].itemId==itemid){
-
 
388
			 			exclusiveAffiliateItem = ExclusiveAffItems[i];
-
 
389
			 			break;
-
 
390
			 		}
-
 
391
			 	}
-
 
392
			 	sellerImg = {
-
 
393
			 		1 : 'flipkart_logo.png',
-
 
394
			 		2 : 'amazon_logo.png',
-
 
395
			 		3 : 'snapdeal_logo.png'
-
 
396
			 	};
-
 
397
			 	if(typeof exclusiveAffiliateItem != "undefined"){
-
 
398
					var innerhtml = '<div class="shipping1 left"><div style="background-color: #FAFAFA;padding:4px;font-size: 14px;">Available on '
-
 
399
						+ exclusiveAffiliateItem.affiliateName+'</div><div style="padding: 10px;background-color:#FFF;padding-left: 136px;background-image: url(\'/images/' + sellerImg[exclusiveAffiliateItem.affiliateId] + '\');background-repeat: no-repeat;background-size: 120px;color: #777777;font-size: 14px;">'
-
 
400
						+ (typeof exclusiveAffiliateItem.offerText=="undefined"?'':exclusiveAffiliateItem.offerText) + '</div></div>';
-
 
401
					$("#addToCart").attr("href", exclusiveAffiliateItem.affiliateUrl);	
-
 
402
					$('div.shipping').hide();
-
 
403
					$(innerhtml).insertAfter('div.shipping');
-
 
404
				}
-
 
405
				
-
 
406
			}
378
		}
407
		}
379
		$('div.mk_deal').hide();
408
		$('div.mk_deal').hide();
380
		$('div.mk_nodeal').show();
409
		$('div.mk_nodeal').show();
381
	} else {
410
	} else {
382
		var itemp = privateDeals[itemid];
411
		var itemp = privateDeals[itemid];