Develop > Presentation layer > Customize promotions > Promotions customization: Management Center


Create a custom promotion type in the Management Center

Add a custom promotion type to the Management Center if the default promotion types supplied with the Promotions tool do not meet the needs.

  1. Determine the kind of promotion type the store requires
    Compare the promotion type requirements against the default promotion types supplied with the Promotions tool. Determine whether you need a customized promotion type, and if so, whether you can reuse elements of the default promotions to simplify the customization. This can save a lot of time compared with implementing something entirely new.

  2. Model the runtime promotion XML
    Model the runtime promotion XML so that you can identify the data that must be managed through the Management Center user interface for the custom promotion type. The information you gather from this task is used in subsequent promotion customization tasks.

  3. Identify the business user input for the new promotion type
    Examine the runtime promotion XML for the custom promotion type to determine which pieces of data a business user must enter using the Management Center user interface. You can then decide which user interface widgets support the custom promotion type.

  4. Create the object definitions for the new promotion type
    Define new OpenLaszlo promotion element object definitions to collect input from the Management Center. When business users create new promotions in the Management Center, the promotion element object definitions persist promotion element data in two tables: PX_ELEMENT and PX_ELEMENTNVP.

  5. Create the object template for the new promotion type
    Create an object template to define the object structure for the custom promotion type. All promotions defined in the Promotions tool use the same primary object definition. The purpose of the object template is to model the differences between the promotion types. There is one object template for each promotion type. The object template contains all the objects that each promotion type requires.

  6. Specify widgets for the promotion type properties view
    Declare the widgets and child list editors for business users to enter data about the new promotion type. By doing this, you create the user interface, called the properties view, for the custom promotion type. The input widgets collect information from business users have already been defined for use in the existing promotion types. When creating a new promotion type, specify which of these widgets you need, and then arrange and customize them as required to support the promotion type.

  7. Add the new promotion type to the Promotion Type Selector window
    In the Promotions tool, business users select the promotion type to use from the Promotion Type Selector window. By default, the new promotion type automatically displays in the All promotions folder. To make the new promotion type easier for business users to find, you might want to add it to an existing folder, or create a new folder containing all custom promotion types.

  8. Register a serialization JSP file for the new object definition
    The serialization JSP file takes the promotion authoring elements from the PX_ELEMENT and PX_ELEMENTNVP tables and displays them in the the Management Center user interface for the new promotion type. Business users can then use this section of the user interface when they create promotions.

  9. Create the XSLT template to transform the promotion XML
    Create a custom XSLT template to transform the authoring promotion XML to the runtime promotion XML. This transformation takes place when a business user activates a promotion based on the custom promotion type.

  10. Update the promotion type configuration file
    For a custom promotion type, identify to the promotion service which XSLT templates to use to transform the authoring promotion XML to the runtime promotion XML. You must also identify which attributes the custom promotion type has.

    To do this, you register the custom XSLT template you created and other attributes for the new promotion type in a new promotion type configuration file.


Related concepts

Runtime promotion XML samples

How promotion data is stored and managed


+

Search Tips   |   Advanced Search