Tutorials > Customize the Consumer Direct sample store
Tutorial: Adding dynamic text
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.
This tutorial shows you how to add a dynamic text message to a store. In this tutorial, the message is a discount disclaimer and the store is the consumer direct sample store.
Learning objectives
By default, the discount details view of the consumer direct sample storedisplays a static message, This discount may not freely combine with other special offers. The best combination allowed will be determined automatically for each order at the checkout, whenever a discount applies, as in the following figure:
During this tutorial, we will replace the static message with a dynamic message, which we will be able to edit using the Change Pages page, as in the following figures:
Time required
Expect this tutorial to take about two hours.
Audience
This tutorial is intended for WebSphere Commerce store developers.
Prerequisites
To complete this tutorial you should be familiar with the following terms and concepts:
- Storefront customization tools
- WebSphere Commerce Flow infrastructure
- Publish a store archive
- Changing text in store pages and in notification messages
Before beginning this tutorial, ensure that:
- You have successfully published the consumer direct sample store.
- You can browse the catalog and view product details.
- You can access the Change Pages page for the consumer direct sample store.
Lessons in this tutorial
- Add properties to hold and display the dynamic text
In this step of the tutorial, we will update the consumer direct sample store dynamic properties files to add a new dynamic text message for the discount disclaimer on the DiscountDetailsDisplay.jsp page.
- Create a preview page for the location of the text message
The Change Pages page features a View Location button for each dynamic message. When a user clicks this button, a preview of the relevant store page is displayed indicating the location on the page where the message will display. The preview page is a standalone HTML page that is identical to the actual store page but with the dynamic message text highlighted.
- Add a section to the storefront configuration file
In this step of the tutorial, we will add a section to the storefront configuration file, StoreFront.xml, that will add an option for setting the discount disclaimer text to the Change Pages page.
- Update the JSP page
In this step of the tutorial, you update the product display JSP page to display the dynamic discount disclaimer message in place of the static message.