tessguefen
5/22/2015 - 3:33 PM

Ajax Powersearch SIDEBAR links (a tags ONLY) - POWERSEARCH

Ajax Powersearch SIDEBAR links (a tags ONLY) - POWERSEARCH

// Add to CTGY. Make sure your "Filters" are in a div with the ID of filter, or else change it.
// I also added the "processing" gif where the products are, it will toggle.
// --- Ajaxified Filters --- //
		function ajaxedFilters() {
			$('#filters a').on('click', function(e) {
				e.preventDefault();
				$('#js-processing-purchase').show();
				$.ajax({
					 url: $(this).attr('href') + '&ajax=1',
					 type:'GET',
					 success: function(data){
					  // Sidebar Filters
						$('#filters').html($(data).find('#filters').html());
						// Product List
						$('#js-product-list').html($(data).find('#js-product-list').html());
						// Top Pagination
						$('#top-pagination').html($(data).find('#top-pagination').html());
						// Bottom Pagination
						$('#bottom-pagination').html($(data).find('#pagination').html());
					 }
				  }).done( function() {
					$('#js-processing-purchase').hide();
					// conformDisplay is extra, remove if you're not on a ReadyTheme or using SD4
					cornerstoneUX.sharedFunctions.conformDisplay();
					ajaxedFilters();
				  }); 
			});
		}
		ajaxedFilters();