Tutorials > Customize the Consumer Direct sample store > Customizing the consumer direct sample store using snippets

< Previous | Next >


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.

In the previous step, you added code to display a catalog entry thumbnail image and other information about the catalog entry in the store's sidebar. By default, the object snippet displays information about discounts related to the catalog entry, as displayed in the following screen capture:


Procedure

  1. In the Enterprise Explorer view, navigate to Stores > Web Content > MyApparelStore > include > styles > style1.

  2. Open the CachedSidebarDisplay.jsp file for editing.

  3. Near the bottom of the file, locate the following code:

    <!--Begin CatalogEntryThumbnailDisplay object snippet -->
    <tr>
    <td>   
    <wcbase:useBean  classname="com.ibm.commerce.catalog.beans.CatalogEntryDataBean"
    scope="page">
           
    <c:set value="11212" target="${catEntryBean}" 
            property="catalogEntryID" />
       
    </wcbase:useBean>
            
    <c:set var="catEntry" value="${catEntryBean}" />
            
    <%@ include file="../images/locale/screensnap/../Snippets/ReusableObjects/CatalogEntryThumbnailDisplay.jspf" 
            %>
    </td>
    </tr>
    <!--End CatalogEntryThumbnailDisplay object snippet-->
    

  4. After the line: <c:set var="catEntry" value="${catEntryBean}" /> , add the following code: <c:set var="hideDiscounts" value="true" />

  5. Save the changes.

To ensure the store header displays properly:

  1. Load the store home page in the Web browser:

    1. If the Web browser is still open from a previous step, click Refresh the current page to refresh the page.

    2. If the Web browser is not open, navigate to Stores > Web Content > MyApparelStore, right-click on index.jsp and select Run As > Run on Server. If the Server Selection window displays, select a server and click Finish.

  2. The store header displays as in the following screen capture:

< Previous | Next >


+

Search Tips   |   Advanced Search