I am implementing an SCA 2019.2 website, and am tr...
# suitecommerce
c
I am implementing an SCA 2019.2 website, and am trying to expose a custom Commerce Category field. I notice that the way commerce categories are fetched in the Categories.Model has been rearchitected in 2019.2 to use a new API endpoint
/api/navigation/v1/categorynavitems/tree
. However, attempting to pass my custom field ID in the
menu_fields
parameter (as indicated by the Categories.Model code) does not seem to do anything. The response JSON still contains only the native (non-custom) Commerce Category fields. https://www.my20192site.com/api/navigation/v1/categorynavitems/tree?currency=USD&site_id=3&c=1234567_SB2&exclude_empty=false&use_pcv=F&pcv_all_items=null&language=en&max_level=3&menu_fields=internalid,name,sequencenumber,displayinsite,custrecord_hide_in_website_menu Expected Result:
Copy code
{
    "data": [
        {
            "categories": [],
            "_debug_requestTime": 1220,
            "fullurl": "/grey-flooring",
            "internalid": "100",
            "level": "1",
            "name": "Grey Flooring",
            "parentIdPath": "",
            "custrecord_hide_in_website_menu": "T"
        },
        ...
    ]
}
Actual Result:
Copy code
{
    "data": [
        {
            "categories": [],
            "_debug_requestTime": 1220,
            "fullurl": "/grey-flooring",
            "internalid": "100",
            "level": "1",
            "name": "Grey Flooring",
            "parentIdPath": ""
        },
        ...
    ]
}
I can reproduce this issue in Postman, as well as checking the
SC.CATEGORIES
object in my web store. Any insight?
b
We ran in to the same issue. 2019.2 does not expose commerce category custom fields via the new API endpoint.
Our workaround was to use the old API endpoint and model
s
I am pretty sure that this is the case, unfortunately.
k
We have found the exact same issue and were told that custom category fields are no longer exposed in the web store as prior versions.
netsuite 1
p
The problem with reverting to the old model is that then you lose (part of) personalized catalogs 😞
another workaround would be merging both api call results but that would impact performance 😞
s
If someone would raise an enhancement request and send me the case/issue number that would be great 😅
p
that's a bug, it's a regression from the previous version 💕
b
Enhancement 565525
❤️ 1
c
@badgerdigital @kkennedydesign Rather than reverting to the 2019.1 backend Categories.Model (in which case I would lose the new PCV functionality and perhaps sacrifice performance as well), my alternative solution was to create a table in SCA Configuration (
"type":"array"
) to store any additional custom metadata for any relevant categories. Then I could read from that data from the front-end Categories.Model, match each row with the relevant category, and implement whatever logic/behavior I want from there
s
Oh neat.
b
Nice workaround! Should be completely unnecessary though.