Troubleshoot and support >


Troubleshoot: Store development

While developing the store, you might experience the following scenarios.


Changing the store to merge products of the same SKU, as inventory checks are made while adding products to the shopping cart

WebSphere Commerce starter stores perform a soft inventory check by default when items are added to the shopping cart. When adding items to the shopping cart, no inventory allocation is performed, as it is usually performed in latter stages of the checkout process. The only check performed while adding items to the shopping cart is to see if there is sufficient inventory to possibly fulfill the current requested quantity for the item being added. It does not, however, take into account any existing items that already exist in the current shopping cart.

To achieve this scenario, change the places where the store allows adding products to the shopping cart, to include passing a merge parameter with a value of *. For example, in the default starter stores, you change the following JSP files:

Add the code within the form that calls the OrderItemAdd command. For example:

<input type="hidden" name="merge" value="*" />

After making these changes, you should be shown an error message, "insufficient inventory to fulfill the request", when trying to add an item to the shopping cart, where the inventory count of the item being added, plus any of the same item in the shopping cart exceeds the total available inventory of the store.

This scenario only occurs if the store does not allow products to be backordered. If the store allows for backorders, adding items to the shopping cart is always successful and an estimated shipping date is displayed.

See OrderItemAdd URLfor more information.


The File not found exception

Due to an operating system limitation, a File not found exception may be thrown during the initial translation of a JSP page when the length of the absolute path of a file that the page references (for example, a JSP page fragment) exceeds 256 characters. As a result, store developers are advised to keep the names of newly created files and directories short and to limit the level of directory nesting.


XHTML validation errors

All JSP pages used in the consumer direct sample store and the B2B direct starter stores conform to the XHTML 1.0 Transitional document type. When examined with HTML validators such as the Rational Application Developer HTML validator, however, several pages result in the following XHTML validation errors:

No start tag (<tr>)

To display multiple items in tables, starter stores make use of custom display logic that determines when to start a new row, when to alternate the color, and so on. Although the result is a fully XHTML-compliant page, the dynamic code appears to have badly formed rows to validators.

Unknown tag ( xx: yyyy)

Unlike top-level JSP pages ( .jsp files), JSP segments ( .jspf files) typically do not contain tag library directives. As a result, validators fail to recognize custom JSP tags, such as <c:choose>, <fmt:message>, and <flow:fileRef>, when they are used in JSP segments.

You may safely ignore these validation errors.


Related tasks

Add a page to the store

Related reference

WebSphere Commerce JSP programming best practices


+

Search Tips   |   Advanced Search