Samples > JSP code snippets


JSP code snippet: Promotion code form

This JSP code snippet displays the following information: the order list and the discounts applied, the promotion code form that allows customers to enter a promotion code, the list of promotion codes entered (for each code, a 'Remove' button is provided to allow customers to remove the code).

This snippet assumes that the promotion code form is in the shopping cart page. If the promotion code form is not in the shopping cart page, change the values for parameter 'URL' and 'errorViewName' accordingly. More information is provided in the JSP comments.

The PromotionCodeForm.jsp file is available under the following directory:


Prerequisites

Before customers can enter a promotion code, create a promotion with a corresponding promotion code, using the WebSphere Commerce Accelerator.


Usage

To use this snippet, you can cut and paste the code from the snippet to the shopping cart page. If the store page is based on the consumer direct sample store, the JSP file for the shopping cart is OrderItemDisplay.jsp.

The two properties files used by this snippet are:

You may want to copy the properties to the proper location, for example, WCDE_INSTALL\workspace\Stores\Web Content\WEB_INF\classes\ store\Snippets\Marketing\Promotions

or merge them with the own properties file and the error message properties file.


Related concepts

Promotion codes


Related tasks

Create a promotion

Activating or deactivating a promotion

Delete a promotion

View a promotion

Changing a promotion


Related information

Tutorial: Customizing the consumer direct sample store using snippets


+

Search Tips   |   Advanced Search