Feature Pack 7 or later

Testing your new widget in the Aurora starter store

In this lesson, you verify that your new widget can be used on the Shopping Cart page for your store.

About this task

Since you converted the default ShopCartDisplay.jsp JSP file to be a site level widget, you can use your new widget to replace the ShopCartDisplay.jsp file. By default the OrderItemDisplay.jsp file calls the ShopCartDisplay.jsp JSP file. Update the OrderItemDisplay.jsp file to call your new widget instead of the ShopCartDisplay.jsp file.

Procedure

  1. Open your development environment, in the Enterprise Explorer view.
  2. Go to Stores\WebContent\Aurora\ShoppingArea\ShopcartSection
  3. Open the file OrderItemDisplay.jsp for editing
  4. Locate the following code:
    <c:import url="/${sdb.jspStoreDir}/ShoppingArea/ShopcartSection/ShopCartDisplay.jsp"/>
    
    Change the code to the following line:
    <c:import url="/Widgets-MyCompany/com.mycompany.commerce.store.widgets.ShoppingCartDetail/ShoppingCartDetail.jsp"/>
    Now, the OrderItemDisplay.jsp file calls the widget that you created.
  5. Save and close the file.
  6. Start or restart the WebSphere Commerce Test Server.
  7. Open the Aurora starter store in a web browser. Add a product to your Shopping Cart, and go to your cart to view the Shopping Cart page. Your Shopping Cart page can resemble the following image.

    Screen capture of the shopping cart page
    Your Shopping Cart page now displays your custom widget to provide the body content of the page.