Search code examples
sap-commerce-cloudzkbackoffice

How to customize pcm backoffice to filter supercategory search result in Hybris


In the BackOffice Product Cockpit, if the user has selected a catalog from the left navigation bar and browse to the product to add new super-category. Now here, while searching category with it's code/name, it gives categories suggestion dropdown with both (stage/Online) results. Which sometimes lead to wrong mapping.

enter image description here

How can I restrict this result to render category only for the selected catalog? Let's say I'm trying to edit Stage product to add supercategory then it should show only stage category in the suggestion.


Solution

  • Finally, I got this.

    Just you need to configure editor-parameter for referenceSearchCondition_catalogVersion like below. The below configuration guarantees that all search results would have the same catalog version as the parent-object with relation to the current editor.

                    <editorArea:attribute qualifier="supercategories">
                        <editorArea:editor-parameter>
                            <editorArea:name>referenceSearchCondition_catalogVersion</editorArea:name>
                            <editorArea:value>{parentObject.catalogVersion}</editorArea:value>
                        </editorArea:editor-parameter>
                    </editorArea:attribute>