Hi!
Please consider this code snippet, to be inserted in your active theme’s functions.php file:
add_action( 'wp_footer', function () { ?>
<script type='text/javascript'>
jQuery( document ).ajaxComplete(function( event, xhr, settings ) {
counter = jQuery('div#wpsl-stores ul li:not(".wpsl-no-results-msg")').length;
console.log('Found '+counter+' stores');
});
</script>
<?php } );
This will output the string “Found X stores” in your javascript console. If you want to write this number inside of an element in your DOM so it is visible (for instance, imagine you have a <div id="store-counter"></div>
, you could use something like:
add_action( 'wp_footer', function () { ?>
<script type='text/javascript'>
jQuery( document ).ajaxComplete(function( event, xhr, settings ) {
counter = jQuery('div#wpsl-stores ul li:not(".wpsl-no-results-msg")').length;
jQuery('div#store-counter').html('Found '+counter+' stores');
});
</script>
<?php } );
I hope that helps.
Regards ??