This article describes how to enable custom product attribute filtering in the ICM advanced search.
Even though custom product attributes are assigned to products, the ability to filter by such attributes and their values is disabled in the advanced search.
The reason is that the custom product attributes must also be added to the standard product attribute group Back Office Search Attributes.
To add custom product attributes manually, navigate to (Master) Catalogs > Product Attribute Groups > Back Office Search Attributes > Attributes and use the "New" button to create new attributes by Name and ID.
The ID must match the custom product attribute ID.
The ICM provides the possibility to import product attribute groups using the XML file import mechanism under (Master) Catalogs > Import & Export > Product Attribute Groups (XML).
<?xml version="1.0" encoding="UTF-8"?> <enfinity xsi:schemaLocation="http://www.intershop.com/xml/ns/enfinity/7.10/bc_product/impex productattributegroup.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.intershop.com/xml/ns/enfinity/7.10/bc_product/impex" major="6" minor="1" family="enfinity" branch="enterprise" build="26.1.0"> <product-attribute-group id="BACKOFFICE_SEARCH_ATTRIBUTES" domain-name="inSPIRED"> <fixed-flag>true</fixed-flag> <type-code>0</type-code> <display-name xml:lang="de-DE">Backoffice-Suchattribute</display-name> <display-name xml:lang="en-US">Back Office Search Attributes</display-name> <description xml:lang="en-US">Advanced searchable attributes</description> <description xml:lang="de-DE">Erweiterte suchbare Attribute</description> <attribute-descriptors> <attribute-descriptor id="Ports quantity"> <position>1.0</position> <display-name xml:lang="en-US">Ports quantity</display-name> <display-name xml:lang="de-DE">Anzahl Anschl\u00fcsse</display-name> </attribute-descriptor> <attribute-descriptor id="Color depth"> <position>2.0</position> <display-name xml:lang="en-US">Color depth</display-name> <display-name xml:lang="de-DE">Farbtiefe</display-name> </attribute-descriptor> [...] </attribute-descriptors> </product-attribute-group> </enfinity>
The preparers AttributeDescriptorPreparer (DBInit) or AddAttributeDescriptorPreparer (DBMigrate) can be used to import product attribute groups by using DBInit / DBMigrate / DBPrepare.
Class1 = com.intershop.component.foundation.dbinit.preparer.AttributeDescriptorPreparer \ com.intershop.demo.responsive.catalog.dbinit.data.product.StandardBackofficeSearchAttributeDescriptors \ com.intershop.demo.responsive.catalog.dbinit.data.product.StandardBackofficeSearchAttributeDescriptorsLocalization \ inSPIRED
The StandardBackofficeSearchAttributeDescriptors properties file creates the attribute descriptors:
########################################################################################################### # MaxAttributeDescriptorID = [optional - the max attribute descriptor ID value. It will be used in the loop where the attribute descriptors are processed. Default value is 10000.] # # AttributeDescriptor.<id>.OwningDomainName = [optional - the name of the domain the attribute descriptor is created in - can also be passed via command line] # AttributeDescriptor.<id>.OwningAttributeGroupID = [required - the ID of the attribute group the descriptor belongs to] # AttributeDescriptor.<id>.attributeDescriptorID = [required - the ID of the attribute descriptor object] # AttributeDescriptor.<id>.Position = [required - an double representing the position in the absolute sort order] # ########################################################################################################### AttributeDescriptor.1.OwningAttributeGroupID = BACKOFFICE_SEARCH_ATTRIBUTES AttributeDescriptor.1.AttributeDescriptorID = Ports quantity AttributeDescriptor.1.Position = 1.0 AttributeDescriptor.2.OwningAttributeGroupID = BACKOFFICE_SEARCH_ATTRIBUTES AttributeDescriptor.2.AttributeDescriptorID = Color depth AttributeDescriptor.2.Position = 2.0 [...]
The StandardBackofficeSearchAttributeDescriptorsLocalization properties file specifies the display names of the attributes:
########################################################################################################### # Property File Format [AttributeDescriptorLocalization_<locale>.properties] # # With this file you control the creation of localized attribute group attributes when dbinit / dbmigrate / dbprepare is called. # # AttributeDescriptor.x.DisplayName = [optional - the title of the attribute descriptor] # ########################################################################################################### AttributeDescriptor.1.DisplayName = Ports quantity AttributeDescriptor.2.DisplayName = Color depth [...]
The domain inSPIRED at the end specifies the domain to which the attribute descriptors are imported.