Tutorials > Customize the Consumer Direct sample store
| Next >
Tutorial: Customizing the consumer direct sample store using snippets
Attention: This tutorial is currently under revision. The content might contain errors or inaccuracies. Subscribe to this page to be notified when an updated version is available.
Create an apparel online store based on the consumer direct sample store and perform customization using JSP and object snippets.
Learning objectives
You will create an apparel online store based on the consumer direct sample store and perform customization using JSP and object snippets.
Time required
Expect this tutorial to take about 3 hours to complete.
You can view a summary of the changes made to the CachedSidebarDisplay.jsp file to use JSP code and object snippets.
Audience
This tutorial is intended for WebSphere Commerce store developers who are responsible for customizing a store.
Prerequisites
Prepare the workspaceYou must install WebSphere Commerce Developer and configure the database to use.
Knowledge prerequisitesEnsure that you have a basic understanding of the following concepts:
- WebSphere Commerce.
- The Java programming language.
- Rational Application Developer.
- JavaServer Pages Standard Tag Library (JSTL).
- The database type, Apache Derby, DB2, or Oracle, used in the WebSphere Commerce development environment.
Lessons in this tutorial
- Publish a consumer direct sample store
WebSphere Commerce provides several sample stores for you to use as a for learning about WebSphere Commerce. In this tutorial, we will publish another consumer direct sample store with the name MyApparelStore that uses an apparel catalog.
- Create a sales catalog in MyApparelStore
In this step, we will create a sales catalog to contain apparel that is on sale at discounted prices.
- Create categories in MyApparelSalesCatalog
In this step, we will populate the sales catalog with two categories to contain sale merchandise: a SaleActivewear category and a SalePants category. The new categories will contain both men's and women's apparel.
- Add merchandise to MyApparelSalesCatalog
In this step, we will add the sale merchandise to the SalesActivewear and SalesPants categories. You will add men's and women's active wear and pants catalog entries to the sales catalog categories so that they can be displayed as featured sale items.
- Display MyApparelSalesCatalog using a JSP code snippet
In this step, we will use the SalesCatalog JSP code snippet to display MyApparelSalesCatalog in the sidebar of MyApparelStore.
- Test MyApparelSalesCatalog
Ensure MyApparelSalesCatalog displays correctly by testing it.
- Create the MyApparelPromotion promotion
In this step, we will use an e-Marketing Spot to display a promotion. You will create a promotion that advertises sale items for 25% off their regular price. The promotion discount will display on the shopping cart page.
- Create the MyApparelSpot e-Marketing Spot
e-Marketing Spots reserve space on the store pages in which personalized marketing content displays. The e-Marketing Spots are used during page creation to reserve space for the dynamic content that will be shown to the customers.
- Display the MyApparelSpot e-Marketing Spot
You will modify the CachedHeaderDisplay.jsp file to display the new e-Marketing Spot. If you completed the section on using the sales catalog JSP code snippet, the e-Marketing Spot will display just below the sales catalogs.
- Test the MyApparelSpot e-Marketing Spot
In this step, we will load the store home page to ensure the new MyApparelSpot e-Marketing Spot displays as expected.
- Import and editing the e-mail template
In the next few steps we will create an e-mail activity using an e-mail template. This e-mail will be sent to a group of customers called a customer segment, and the e-mail will contain the e-Marketing Spot you created in previous steps.
- Register the e-mail template
In this step, you insert an entry into the database that contains the path to the JSP page that contains the e-mail template.
- Prepare the e-mail content
The contents of the e-mail are stored in a properties file. In this step you add the contents of the e-mail to the storetext properties file.
- Create a customer segment and customer to target with the e-mail activity
A customer segment is a group of customers related by some attribute. For example, you can create a customer segment that consists of all customers who are part of a certain age range, or who have all purchased a certain product. Marketing managers use these segments to target specific customers. For example, the store sells books and a new mystery book is released, you can send a targeted e-mail to all customers who purchased mystery books in the past.
- Create an e-mail activity
In this step we will create an e-mail activity, and we will choose the e-mail template and customer segment created in previous steps.
- Display a catalog entry thumbnail using an object snippet
In this step, we will use an object to display a catalog entry thumbnail image and other information about the catalog entry. You will add code to display this catalog entry thumbnail image above the e-Marketing Spot that you created in a previous step in this tutorial. The name of the file that contains the object snippet is CatalogEntryThumbnailDisplay.jspf.
- Add parameters to send to the object snippet
In this step, we will set a parameter called hideDiscounts to true so that discount information does not display.
- Create a new parameter for CatalogEntryThumbnailDisplay.jspf
In this step, we will modify CatalogEntryThumbnailDisplay.jspf so that the price does not display in the store sidebar. The CatalogEntryThumbnailDisplay.jspf file uses another object snippet, CatalogEntryPriceDisplay.jspf to display the catalog entry price. You will create a new parameter named hidePrice that controls whether the price of the catalog entry displays, then set the hidePrice parameter to true in the JSP file before including CatalogEntryThumbnailDisplay.jspf.
- Deploy the snippet changes
In this tutorial, you performed actions usually performed by multiple roles. Actions that involved creating assets using WebSphere Commerce Accelerator are not usually performed by a store developer. For example, a sales catalog will likely be created by a Category or Product Manager, and a promotion created by a Marketing Manager.
- Summary of customizing the consumer direct sample store using snippets
In this tutorial you learned that: JSP code snippets can be added to the store pages to display store assets such as sales catalogs and e-Marketing Spots; E-mail activities use e-mail templates, and these templates can be modified to display e-Marketing spots; Object snippets help you collect and display information in the store. Object snippets use JSTL in place of Java code.
- Example: Using JSP code and object snippets
This section describes an example using JSP code and object snippets.
| Next >