var categoryCounts = {"543":"203","545":"11","546":"11","547":"8","548":"8","549":"26","550":"26","551":"27","552":"4","553":"4","554":"5","555":"9","556":"7","557":"9","558":"11","559":"9","560":"7","561":"7","562":"7","563":"7","564":"7","565":"7","566":"7","567":"7","568":"7","570":"14","571":"20","572":"19","573":"19","574":"19","575":"19","576":"12","577":"12","578":"18","579":"18","580":"9","581":"9","582":"14","583":"14","584":"13","585":"7","586":"7","587":"7","588":"7","589":"7","590":"7","591":"10","592":"17","593":"14","594":"9","595":"5","596":"11","598":"10","599":"10","600":"7","601":"6","602":"11","603":"12","604":"12","605":"4","606":"6","607":"4","610":"27","612":"28","613":"4","614":"4","615":"11","616":"11","617":"11","618":"11","619":"11","620":"11","621":"11","622":"9","623":"9","624":"9","625":"14","626":"4","627":"2","628":"3","629":"12"}; $( ".catalog-filter-count li.cat-item" ).each( function( index, item ) { var itemId = $(item).data( "id" ); $("> a.cat-item", item).append( function() { if( categoryCounts[itemId] ) { return ' ' + categoryCounts[itemId] + ''; } $(item).addClass( 'disabled' ); }); }); var attributeCounts = {}; $( ".catalog-filter-attribute .attribute-lists li.attr-item" ).each( function( index, item ) { $(item).append( function() { var itemId = $(this).data( "id" ); if( attributeCounts[itemId] ) { var node = document.createElement( 'span' ); node.appendChild( document.createTextNode( attributeCounts[itemId] ) ); $(node).addClass( 'attr-count' ); return node; } $(this).addClass( 'disabled' ); }); });