Code snippet to display items in ShoppingCart
Code snippet to add item to order
<dsp:form action="genericproduct.jsp" method="post">
<input name="id" type="hidden"
value='<dsp:valueof param="product.repositoryId"/>'>
<dsp:input type="hidden" value="shoppingcart.jsp"
bean="CartModifierFormHandler.
addItemToOrderSuccessURL"/>
<dsp:input type="hidden" value="session_expired.jsp"
bean="CartModifierFormHandler.
sessionExpirationURL" />
<dsp:input type="hidden"
paramvalue="product.repositoryId"
bean="CartModifierFormHandler.productId"/>
<dsp:select
bean="CartModifierFormHandler.catalogRefIds">
<dsp:droplet name="/atg/dynamo/droplet/ForEach">
<dsp:param name="array" param="product.childSKUs"/>
<dsp:param name="indexName" value="skuIndex"/>
<dsp:oparam name="output">
<dsp:param name="sku" param="element"/>
<option value='<dsp:valueof
param="sku.repositoryId"/>'/>
<dsp:valueof param="sku.displayName"/>
</dsp:oparam>
</dsp:droplet>
</dsp:select>
Quantity: <dsp:input type="text" value="1" size="4"
bean="CartModifierFormHandler.quantity"/> <BR>
<dsp:input type="submit" value="Add To Cart"
bean="CartModifierFormHandler.addItemToOrder" />
</dsp:form>
Code to display Shopping cart Summary on Top of the Page
<dsp:setvalue param="NumItems"
beanvalue="/atg/commerce/ShoppingCart.current.
TotalCommerceItemCount"/>
<dsp:droplet name="/atg/dynamo/droplet/Switch">
<dsp:param name="value" param="NumItems"/>
<dsp:oparam name="1">
1 item (<dsp:valueof converter="currency"
bean="/atg/commerce/ShoppingCart.
current.priceInfo.amount"/>)
</dsp:oparam>
<dsp:oparam name="default">
<dsp:valueof param="NumItems"/> items (<dsp:valueof
converter="currency" bean="/atg/commerce/ShoppingCart.
current.priceInfo.amount"/>)
<dsp:droplet name="ForEach">
<dsp:param name="array"
bean="CartModifierFormHandler.order.commerceItems"/>
<dsp:oparam name="output">
<dsp:param name="Ci" param="element"/>
<input type="text" size="4"
value='<dsp:valueof param="Ci.quantity"/>'>
<dsp:valueof param="Ci.catalogRefId"/>
<dsp:valueof converter="currency"
param="Ci.priceInfo.listPrice">no price</dsp:valueof>
<dsp:valueof converter="currency"
param="Ci.priceInfo.amount">no price</dsp:valueof>
</dsp:oparam>
</dsp:droplet>
<dsp:form action="genericproduct.jsp" method="post">
<input name="id" type="hidden"
value='<dsp:valueof param="product.repositoryId"/>'>
<dsp:input type="hidden" value="shoppingcart.jsp"
bean="CartModifierFormHandler.
addItemToOrderSuccessURL"/>
<dsp:input type="hidden" value="session_expired.jsp"
bean="CartModifierFormHandler.
sessionExpirationURL" />
<dsp:input type="hidden"
paramvalue="product.repositoryId"
bean="CartModifierFormHandler.productId"/>
<dsp:select
bean="CartModifierFormHandler.catalogRefIds">
<dsp:droplet name="/atg/dynamo/droplet/ForEach">
<dsp:param name="array" param="product.childSKUs"/>
<dsp:param name="indexName" value="skuIndex"/>
<dsp:oparam name="output">
<dsp:param name="sku" param="element"/>
<option value='<dsp:valueof
param="sku.repositoryId"/>'/>
<dsp:valueof param="sku.displayName"/>
</dsp:oparam>
</dsp:droplet>
</dsp:select>
Quantity: <dsp:input type="text" value="1" size="4"
bean="CartModifierFormHandler.quantity"/> <BR>
<dsp:input type="submit" value="Add To Cart"
bean="CartModifierFormHandler.addItemToOrder" />
</dsp:form>
Code to display Shopping cart Summary on Top of the Page
<dsp:setvalue param="NumItems"
beanvalue="/atg/commerce/ShoppingCart.current.
TotalCommerceItemCount"/>
<dsp:droplet name="/atg/dynamo/droplet/Switch">
<dsp:param name="value" param="NumItems"/>
<dsp:oparam name="1">
1 item (<dsp:valueof converter="currency"
bean="/atg/commerce/ShoppingCart.
current.priceInfo.amount"/>)
</dsp:oparam>
<dsp:oparam name="default">
<dsp:valueof param="NumItems"/> items (<dsp:valueof
converter="currency" bean="/atg/commerce/ShoppingCart.
current.priceInfo.amount"/>)
super up notes admin....
ReplyDelete