Siebel Interactive Selling Transact Server Interface Reference > The Shopping Cart >

Accessing Line Item Data

Since there are potentially multiple line items in a quote, a standard iteration is used to access each line item in succession. The format is always:

while ( bean.hasMoreLineItems() )
bean.nextLineItem(); %>

The while statement begins the iteration. It allows the next statements to be repeated until the condition inside the parenthesis is false, exactly as it would be in JavaScript or any other programming language. The condition statement is a call to the ShoppingCartBean named hasMoreLineItems, so the loop will continue until we have gone through all the line items in the quote. The first statement inside the loop is another call to the ShoppingCartBean to get the next line item, named nextLineItem.

Once inside this loop, any information about the current line item may be accessed. The loop is ended with an end curly bracket within the JSP code block tags <% } %>. Line item index (a counter of which line item is being displayed), linkback URL, and line item description are a few of the pieces of line item information which you may want to display on the cart. A full listing of function calls providing line item data access are given in the API Appendix.

Custom fields may not be created at the line item level, but they may be created at the part level, which provides essentially identical functionality.

 Siebel Interactive Selling Transact Server Interface Reference 
 Published: 18 April 2003