If the customer doesn’t want to purchase the product at the time, but wants to save the item for future purchase, he can save it in any of his existing purchase lists as shown in the following code fragment from AddToList.jsp:

<dsp:form action="product.jsp" method="post">
   <input name="id" type="hidden" value="<dsp:valueof param=
      "product.repositoryId"/>">
   <dsp:input bean="PurchaselistFormHandler.addItemToPurchaselistErrorURL"
      type="hidden" value="product.jsp"/>
   <dsp:input bean="PurchaselistFormHandler.productId"
      paramvalue="product.repositoryId" type="hidden"/>
   <dsp:droplet name="/atg/dynamo/droplet/ForEach">
      <dsp:param name="array" param="product.childSKUs"/>
      <dsp:oparam name="output">
         <table border=0 cellpadding=3 width=100%>
            <tr>
               <td><dsp:input bean="PurchaselistFormHandler.catalogRefIds"
                  paramvalue="element.repositoryId" type="hidden"/>
               <span class=smallb>Qty</span>&nbsp;
               <dsp:input bean="PurchaselistFormHandler.quantity" size="2"
                  type="text" value="1"/>&nbsp;
      </dsp:oparam>
   </dsp:droplet>

   <dsp:select bean="PurchaselistFormHandler.purchaseListId">
      <dsp:droplet name="ForEach">
         <dsp:param bean="Profile.purchaselists" name="array"/>
         <dsp:oparam name="output">
            <dsp:getvalueof id="elem" idtype="atg.repository.RepositoryItem"
               param="element">
            <dsp:option value="<%=elem.getRepositoryId()%>"/>
            <dsp:valueof param="element.eventName">Unnamed Purchase List
            </dsp:valueof>
            </dsp:getvalueof>
         </dsp:oparam>
      </dsp:droplet>
   </dsp:select></td>
   </tr>
   <tr>
      <td><dsp:input bean="PurchaselistFormHandler.addItemToPurchaselist"
         type="submit" value="Add to list"/></td>
   </tr>

   <tr>
      <td>
         <table border=0 cellpadding=3 width=100%>
         <tr>
            <td><span class=smallb><dsp:a href=
               "../user/purchase_lists.jsp?noCrumbs=false"><dsp:param
               name="product" param="product.repositoryId"/><dsp:param
               name="noCrumbs" value="false"/>Create new purchase
               list</dsp:a></span></td>
         </tr>
         </table>
      </td>
   </tr>

</table>
</dsp:form>

We used PurchaseListFormHandler to add the given item to any of the purchase lists. We iterate through all the SKUs of the product providing an input option of quantity of item, and provide all the existing purchase lists of the customer in the dropdown box to choose one of them.


Copyright © 1997, 2012 Oracle and/or its affiliates. All rights reserved. Legal Notices