Technote

(troubleshooting)
Customizing the XML of a default promotion.
Problem(Abstract)
You would like to customize the XML of a default promotion.
Resolving the problem

  1. Open WebSphere Commerce Accelerator.

  2. From the Marketing menu, select Promotions.

  3. Click New.

  4. Create a new promotion leaving most settings as their default values. Fill in only what is required to create the promotion. Everything can be changed except the NAME and DESCRIPTION, when you do the customization.

  5. Confirm that the new promotion is in the WebSphere Commerce Database.

    select px_promotion_id, name from px_promotion where name='NAME_OF_YOUR_NEW_PROMOTION' and status=1 and storeent_id=YOUR_STOREENT_ID

  6. Output the configuration of the promotion to a text file (replaceYOUR_PROMOTION_IDwith the value you saw in step 6).

    select xmlparam from px_promotion where px_promotion_id=YOUR_PROMOTION_ID> promo_xml.txt

  7. Customize the promotion XML text file to work as you would like. Follow the promotion XML example.

  8. In a text editor, remove all space characters and newline characters between XML tags so it is a single line. This can be done using UltraEdit, but these features should be available in most text editors.
    UltraEdit commands are in parenthesis:

    1. Trim trailing spaces (Format->Trim Trailing Spaces).

    2. Trim leading spaces (Format->Paragraph Formatting->Left Align text).

    3. Replace newlines with nothing (View->Show Spaces and Tabs; Select and Copy a newline character; Search->Replace, paste newline character in the find field, make sure replace is empty; Click Replace All).

    4. Remove extra spaces between tags (Search->Replace, set '> <' to be the find string, set '><' to be the replace string; Click Replace All).

  9. Load this line into the database replacing the xmlparam from the original promotion:

    update px_promotion set xmlparam='<?xml version="1.0" encoding="UTF-8"?>
    .......</Promotion>' where px_promotion_id=YOUR_PROMOTION_ID


    NOTE: The update in Step 9 can be troublesome on a db2cmd command line, due to a buffer that is not big enough. It is much easier to issue the command using the DB2 Command Center.

  10. You should be able to see your promotion in WebSphere Commerce Accelerator.

  11. Activate the new promotion.

  12. Browse the store to see if the pattern of the new promotion is in effect.

    NOTE: For some customizations made in this manner you will not be able to alter your promotion from WebSphere Commerce Accelerator (the GUI does not support it). To make changes to your promotion conditions and rewards you would need to repeat the preceding steps. See the Promotions Customizations guide for more information on how to customize promotions so that they can be edited in the WebSphere Commerce Accelerator.


Change History
Last Updated: 4 December 2007

Cross Reference information
Segment Product Component Platform Version Edition
Commerce WebSphere Commerce Enterprise Customization / Application Development AIX, i5/OS, Linux, Solaris, Windows 6.0, 6.0.0.1, 6.0.0.2, 6.0.0.3, 6.0.0.4
Commerce WebSphere Commerce Business Edition Customization / Application Development AIX, i5/OS, Linux, Solaris, Windows 5.6, 5.6.1, 5.6.1.1, 5.6.1.2, 5.6.1.3, 5.6.1.4
Commerce WebSphere Commerce - Express Customization / Application Development i5/OS, Linux, Windows 5.6, 5.6.1, 5.6.1.1, 5.6.1.2, 5.6.1.3, 5.6.1.4, 6.0, 6.0.0.1, 6.0.0.2, 6.0.0.3, 6.0.0.4
Commerce WebSphere Commerce Developer Enterprise Customization / Application Development Windows 6.0, 6.0.0.1, 6.0.0.2, 6.0.0.3, 6.0.0.4
Commerce WebSphere Commerce Developer Business Edition Customization / Application Development Windows 5.6, 5.6.1, 5.6.1.1, 5.6.1.2, 5.6.1.3, 5.6.1.4
Commerce WebSphere Commerce Developer Express Customization / Application Development Windows 5.6, 5.6.1, 5.6.1.1, 5.6.1.2, 5.6.1.3, 5.6.1.4, 6.0, 6.0.0.1, 6.0.0.2, 6.0.0.3, 6.0.0.4
 

Product Alias/Synonym
WC WCS WC56 WCS56 5.6 56
   

Document Information

Current web document: http://www.ibm.com/support/docview.wss?uid=swg21232942