Created
September 5, 2013 18:10
-
-
Save JumboLove/6453874 to your computer and use it in GitHub Desktop.
Iterate Upward Through Categories
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
var sizeChartID = null; | |
var category = pdict.Product.primaryCategory; | |
while (category !== null && sizeChartID === null) { | |
if (('sizeChartID' in category.custom) && !empty(category.custom.sizeChartID)) { | |
sizeChartID = category.custom.sizeChartID; | |
} | |
else { | |
category = category.parent; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment