Created
December 26, 2013 03:57
-
-
Save coopermaruyama/8129607 to your computer and use it in GitHub Desktop.
Magento: Check if a category page contains any duplicate products
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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