Support Article - Setup of the Advanced Search with Custom Product Attributes

1 Introduction

This article describes how to enable custom product attribute filtering in the ICM advanced search. 

1.1 References

2 Problem

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.

3 Add Attributes to a Product Attribute Group

3.1 Add Attributes Manually

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.

3.2 Import Product Attribute Groups using XML Import (valid from ICM 7.10)

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).

Example XML File Structure
<?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>
For further details on XML import specifications, see Reference - Product Attribute Groups XML Import Specification.

3.3 Import Product Attribute Groups via DBInit / DBMigrate / DBPrepare

The preparers AttributeDescriptorPreparer (DBInit) or AddAttributeDescriptorPreparer (DBMigrate) can be used to import product attribute groups by using DBInit / DBMigrate / DBPrepare.

Example dbinit.properties
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:

Example StandardBackofficeSearchAttributeDescriptors.properties
###########################################################################################################
#  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:

Example StandardBackofficeSearchAttributeDescriptorsLocalization_en.properties
###########################################################################################################
#  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.

Disclaimer

The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

Customer Support
Knowledge Base
Product Resources
Tickets