Display current category in the left navigation of category page

In the extension, call the PLP container and then modify the displayValues.

                     plp.addToViewContextDefinition('Facets.FacetedNavigationItemCategory.View', 'displayValues', 'array', function(context) {
                    var categoryinfo = plp.getCategoryInfo();
                    console.log("categoryinfo", categoryinfo);


                    var currentCategory = {
                        displayName: categoryinfo.name,
                        isActive: true,
                        label: categoryinfo.name,
                        link: categoryinfo.fullurl
                    }
                    if (categoryinfo.parenturl != "") {
                        context.displayValues.push(currentCategory);
                    }
                    return _.sortBy(context.displayValues, 'displayName');
                });

Leave a comment

Your email address will not be published. Required fields are marked *