Closed ben-yeung closed 3 years ago
Extracting the style id and color id works pretty well after implementing. Still testing but Nike, Jordan, and Adidas is returning results. When the url contains 'adidas' only the styleId attribute is used. For other brands such as Nike or Jordan the colorId is appended to the end of the styleId.
FinishLine links seem to be more friendly with providing the style codes for shoes: https://www.finishline.com/store/product/mens-new-balance-327-casual-shoes/prod2800652?styleId=MS327PBA&colorId=407
The one roadblock is how colorIDs are treated. For example, Adidas and New Balance shoes can be found by using the styleId only when calling the StockX api.
Jordans, however, need both the style id and color id added in order to fetch the correct colorway. From testing so far it appears that Adidas and other brands like New Balance seem to differentiate shoes without the need of colorId.
This would mean that before setting the api url we would need to identify the current shoe's brand and then appropriately concatenate a style id string.
First approach that comes to mind would be checking the url directly via .includes( ) to see which brand is present.