Skip to content

Instantly share code, notes, and snippets.

@coopermaruyama
Created December 26, 2013 03:57
Show Gist options
  • Save coopermaruyama/8129607 to your computer and use it in GitHub Desktop.
Save coopermaruyama/8129607 to your computer and use it in GitHub Desktop.
Magento: Check if a category page contains any duplicate products
pocket = []; //initialize an array to store urls to check
$("li.item").each(function(index,value){
$(this).find("a").each(function() {
if (/[0-9]+.html/.test($(this).attr("href"))) {
pocket.indexOf($(this).attr("href")) > -1 ? console.log("found duplicate:"+$(this).attr("href")) : pocket.push($(this).attr("href"));
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment