Subversion Repositories SmartDukaan

Rev

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

Rev 10190 Rev 10198
Line 398... Line 398...
398
		});
398
		});
399
	}
399
	}
400
}
400
}
401
 
401
 
402
function load_accessories_widget(){
402
function load_accessories_widget(){
403
	if(Entity.isComparable)
-
 
404
	{
-
 
405
		var accessoriesContainer = $("#accessories");
403
	var accessoriesContainer = $("#accessories");
406
		
-
 
407
		if(accessoriesContainer.length == 0) {
-
 
408
			return;
-
 
409
		}
-
 
410
	
404
	
411
		jQuery.ajax({
-
 
412
			type : "GET",
-
 
413
			url : "/related-accessories/" + $("#product_id").val(),
-
 
414
			cache: true,
-
 
415
			success : function(html) {
-
 
416
				
-
 
417
				if($.trim(html).length > 0)	{
-
 
418
		   		    $(accessoriesContainer).html(html);
405
	if(accessoriesContainer.length == 0) {
419
		   		    
-
 
420
		   		    var accessoryInfoContainer = $(accessoriesContainer).find("table td div");
-
 
421
				    // Product Title
-
 
422
				    $(accessoryInfoContainer).children("a").each(function() {
-
 
423
				    	$(this).truncate({addtitle : true});
-
 
424
				    });
-
 
425
	
-
 
426
				    // Product Price
-
 
427
				    $(accessoryInfoContainer).children("div.price").each(function() {
-
 
428
				    	$(this).truncate({addtitle : true});
-
 
429
					});
-
 
430
	
-
 
431
				    // Product Details
-
 
432
				    $(accessoryInfoContainer).children("div.text").each(function() {
-
 
433
				    	$(this).truncate( {addtitle : true});
-
 
434
					});
406
		return;
435
				} else	{
-
 
436
					$(accessoriesContainer).hide();
-
 
437
				}
-
 
438
		    }
-
 
439
		});
-
 
440
	}
407
	}
-
 
408
 
-
 
409
	jQuery.ajax({
-
 
410
		type : "GET",
-
 
411
		url : "/related-accessories/" + $("#product_id").val(),
-
 
412
		cache: true,
-
 
413
		success : function(html) {
-
 
414
			
-
 
415
			if($.trim(html).length > 0)	{
-
 
416
	   		    $(accessoriesContainer).html(html);
-
 
417
	   		    
-
 
418
	   		    var accessoryInfoContainer = $(accessoriesContainer).find("table td div");
-
 
419
			    // Product Title
-
 
420
			    $(accessoryInfoContainer).children("a").each(function() {
-
 
421
			    	$(this).truncate({addtitle : true});
-
 
422
			    });
-
 
423
 
-
 
424
			    // Product Price
-
 
425
			    $(accessoryInfoContainer).children("div.price").each(function() {
-
 
426
			    	$(this).truncate({addtitle : true});
-
 
427
				});
-
 
428
 
-
 
429
			    // Product Details
-
 
430
			    $(accessoryInfoContainer).children("div.text").each(function() {
-
 
431
			    	$(this).truncate( {addtitle : true});
-
 
432
				});
-
 
433
			} else	{
-
 
434
				$(accessoriesContainer).hide();
-
 
435
			}
-
 
436
	    }
-
 
437
	});
441
}
438
}
442
439