You can create custom merchandising association types based
on your requirements. For example, you may want to offer a down-sell
merchandising association to suggest lower-priced catalog entries
based on the selected catalog entry.
About this task
All custom merchandising associations defined in the WebSphere
Commerce Server are listed in the Merchandising Associations view,
but cannot be applied to an order or quote without customization.
In the Sales Center, supported
merchandising associations can be applied in two ways:
- By selecting the association in the Merchandising Associations
view; then right-clicking and choosing Apply in
the context menu.
- By selecting the association in the Merchandising Associations
view; then dragging it to the Order Items table in the Order editor.
In order to allow custom association types, you must customize
the Sales Center and drag sides of the application. To apply custom
merchandising associations:
Procedure
- To customize the drag side of the application:
- Extend the ModelRoot class and override the getSupportedAssociationTypes
method to return the custom list of supported association types.
The list of supported association types are retrieved
from ModelRoot class to check before allowing any associations to
drag and apply.
- Extend the Association class and override the getAssociationTypeToDisplay
and getAssociationImage methods to customize the display name and
icon for the associations.
- To customize the drop side of the application:
- Extend the DropAssociationAction class and override
the doAssociationDrop method to add your logic while applying the
associations to the order.
The DropAssociationAction
class is responsible for performing the drop activity for any supported
association types to the Order Items table in the Order editor.