Closed dunagan5887 closed 8 years ago
techhnically we can take up to 2 slugs in the categories field
With this latest commit, up to two category slugs will be passed to Reverb (the two deepest categories the product is mapped to). The product slug of the deepest Reverb category will be passed as well (will always be passed, it was like that before, the comments were just wrong)
In the event that a product is mapped to 2 second-level Reverb categories, the decision is arbitrary regarding which product slug is passed to Reverb. Both of their category slugs would be passed
thanks :+1: - i'm not 100% sure of why you're having to explode the categories by their " > " though as in the api response there are "categories" and there are "subcategories". i would assume you would build an in memory hash representation of the same...not sure. but i'll merge this for now thanks!
Accounting for the potential down the road of additional nesting layers
I just tested - this code is not correct. It is mixing up categories and produt_types. Here is the request it generated:
"categories":["pro-audios"],"product_type":"microphones"
Instead, the product_type should be pro-audios, and the cateogries should be microphones:
I'm reverting the commit for now as it makes things worse
to fix this, you'll probably want to revert my revert which is commit: 63136d6
The latest commit to https://github.com/reverbdotcom/reverb-magento/tree/issues/github_164 reverses your commit and addresses the issue. It will require clients to re-map their categories though
Fix #164
This will resolve the nil issue, as well as implement prioritizing subcategories over top-level categories. It will also result in only one category's slug being sent in the "categories" array field. Let me know if you want that to be updated