that @mtbroutes page is awesome. if you want to find all products sorted by discount, open that link (desktop), press f12, and in the console whack the following – it should show all in-stock products sorted by discount amount. For some reason its not working 100% – the items are sorted but also grouped so it goes 99->0 a couple of times. no idea why – maybe a parent div issue or something, I haven’t done js in about 20 years
$(“.productList”).first().html( $(‘li’).sort(function (a, b) {
var contentA =parseInt( $(a).find(‘.discount_percent’).text().replace(‘(‘, ”).replace(‘)’,”).replace(‘%’,”));
var contentB =parseInt( $(b).find(‘.discount_percent’).text().replace(‘(‘, ”).replace(‘)’,”).replace(‘%’,”));
return (contentA < contentB) ? -1 : (contentA > contentB) ? 1 : 0;
})).show().parent().show();