Sample store - do not use as a base for a production site

Changing store pages

The JSP pages that are provided with the consumer direct sample store can be changed. The Registration page is used as an example, but the same methods can be applied to other pages.

Some of the most commonly used data beans and commands in the consumer direct sample store are listed below:

StoreErrorDataBean
Communicates error information to a JSP page.
StoreDataBean
Contains store-specific information, such as the store identifier and catalog identifier for the store.
OrderDataBean
Represents an order.
UserRegistrationDataBean
Represents the registration information for a member.
ProductDataBean
Represents a product and all of its attributes.

Many form elements in the consumer direct sample store use the ECUserConstants class. This class contains constants that specify the name of a form element, for example:


<input size="25" maxlength="50" 
        names="firstName" 
        type="text" value="<c:out value="$(firstname)"/>">
The Registration page allows customers to register at the store. When customers register, they must provide their First Name, Last Name, a Logon ID, and an email address, and then create a password; these fields are required. Additionally, the Registration page might display the following optional fields:
  • Preferred language
  • Preferred currency
  • Age
  • Gender
  • Send me email about store specials
Note: These fields can be removed through the Change Flow notebook.
Default registration page

Procedure

  1. Open the Registration page source file, UserRegistrationAddForm.jsp, found in the following directory:
    • WC_eardir/Stores.war/ storedir/UserArea/AccountSection/RegistrationSubsection
    • WebSphere Commerce Developer workspace_dir\Stores\Web Content\ storedir\UserArea\AccountSection\RegistrationSubsection
  2. Place one or more fields in the wanted location on the form.
  3. Name each field by its associated UserRegistrationAdd parameters using the ECUserConstants class.
  4. Set the values for the page element in the properties file.
  5. Edit the JSP file to get the text values for that element from the properties file.
  6. Test the changes.
  7. Modifying properties files.
    All text that is displayed on store pages is contained in the following locale-specific properties files:
    storetext_dynamic_ locale.properties
    This file contains most of the text on consumer direct sample store and the text in notification messages. Use the Change Pages page to modify the text in this properties file.
    storetext_ locale.properties
    This file contains error messages and field labels that are used in the consumer direct sample store. You cannot use the Change Pages page to modify the text in this properties file. Instead, you must edit the file and then stop and restart the WebSphere Commerce Server.

    The files are in the following directory:

    • WC_eardir/Stores.war/storedir/UserArea/AccountSection/RegistrationSubsection/WEB-INF/classes/ storedir
    • WebSphere Commerce Developer workspace_dir\Stores\Web Content\WEB-INF\classes\ storedir