Subversion Repositories SmartDukaan

Rev

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

Rev 3830 Rev 4210
Line 424... Line 424...
424
		});
424
		});
425
	}
425
	}
426
}
426
}
427
 
427
 
428
function load_accessories_widget(){
428
function load_accessories_widget(){
-
 
429
	var accessoriesContainer = $("#accessories");
-
 
430
	
429
	if($("#accessories").length == 0) {
431
	if(accessoriesContainer.length == 0) {
430
		return;
432
		return;
431
	}
433
	}
-
 
434
 
432
	jQuery.ajax({
435
	jQuery.ajax({
433
		type : "GET",
436
		type : "GET",
434
		url : "/related-accessories/" + $("#product_id").val(),
437
		url : "/related-accessories/" + $("#product_id").val(),
435
		cache: true,
438
		cache: true,
436
		success : function(html) {
439
		success : function(html) {
-
 
440
			
-
 
441
			if($.trim(html).length > 0)	{
437
   		    $("#accessories").html(html);
442
	   		    $(accessoriesContainer).html(html);
438
 
443
	   		    
-
 
444
	   		    var accessoryInfoContainer = $(accessoriesContainer).find("table td div");
439
		    // Product Title
445
			    // Product Title
440
		    $("#accessories table td div a").each(function() {
446
			    $(accessoryInfoContainer).children("a").each(function() {
441
					$(this).truncate({addtitle : true});
447
			    	$(this).truncate({addtitle : true});
442
		    });
448
			    });
443
 
449
 
444
		    // Product Price
450
			    // Product Price
445
		    $("#accessories table td div div.price").each(function() {
451
			    $(accessoryInfoContainer).children("div.price").each(function() {
446
					$(this).truncate({addtitle : true});
452
			    	$(this).truncate({addtitle : true});
447
			});
453
				});
448
 
454
 
449
		    // Product Details
455
			    // Product Details
450
		    $("#accessories table td div div.text").each(function() {
456
			    $(accessoryInfoContainer).children("div.text").each(function() {
451
					$(this).truncate( {addtitle : true});
457
			    	$(this).truncate( {addtitle : true});
452
			});
458
				});
-
 
459
			} else	{
-
 
460
				$(accessoriesContainer).hide();
-
 
461
			}
453
	    }
462
	    }
454
	});
463
	});
455
}
464
}
456
465