This discussion is archived
7 Replies Latest reply: Oct 27, 2012 2:39 AM by RMishra RSS

Implementing Shopping cart

970599 Newbie
Currently Being Moderated
I wrote the code for implementing only one shopping cart. BUt there is problem. I wrote this code but it's not able to populate the sku's id.
I am using CRS database. And implementing own project.

<dsp:importbean bean="/atg/commerce/order/purchase/CartModifierFormHandler"/>
<dsp:importbean bean="/atg/dynamo/droplet/ForEach"/>
<dsp:input bean="CartModifierFormHandler.ProductId" paramvalue="Product.repositoryId" type="hidden"/>
<input value='<dsp:valueof param="Product.repositoryId"/>' type="hidden" name="id">
<table>
<tr><td class=box-top-store>Add to Cart</td></tr>
<tr><td class=box>

Add
<dsp:input bean="CartModifierFormHandler.quantity" size="4" value="1" type="text"/>
<dsp:select bean="CartModifierFormHandler.catalogRefIds">
<dsp:droplet name="ForEach">
<dsp:param param="Product.childSKUs" name="array"/>
<dsp:param value="Sku" name="elementName"/>
<dsp:param value="skuIndex" name="indexName"/>
<dsp:oparam name="output">
<dsp:getvalueof id="opt" param="Sku.repositoryID" idtype="java.lang.String">
<dsp:option value="<%=opt%>"/>
</dsp:getvalueof>
<dsp:valueof param="Sku.displayName"/>
</dsp:oparam>
</dsp:droplet>
</dsp:select>
<br>
<dsp:input bean="CartModifierFormHandler.addItemToOrder"
value="Add to Cart" type="submit"/>
</td>
</tr>
</table>

please look into it.
Thanks
  • 1. Re: Implementing Shopping cart
    RMishra Journeyer
    Currently Being Moderated
    your code is correct. Can you recheck in ACC if product have skus. Also just print to check <dsp:valueof param="product.displayName"/>.

    -RMishra
  • 2. Re: Implementing Shopping cart
    970599 Newbie
    Currently Being Moderated
    thanks for replying.
    I added ur code but it's not showing any progess.
    If you get any update about it..
    Please let me know
  • 3. Re: Implementing Shopping cart
    RMishra Journeyer
    Currently Being Moderated
    <dsp:valueof param="product.displayName"/> should print your product name. if it is not, then check:
    -you are able to show all entries in ACC
    -check if you are able to print catagories-
    -check if product name parameter that you are passing from category page is same as in product page.
    -check if SKU name parameter that you are passing from product page is same as in product page.
    -RMishra
  • 4. Re: Implementing Shopping cart
    karthik chopperla Pro
    Currently Being Moderated
    It is not Sku.repositoryId. It is "Sku.id".You can also say <dsp:valueof param="Sku.id"/> instead of the below 2 lines.

    <dsp:getvalueof id="opt" param="Sku.repositoryID" idtype="java.lang.String">
    <dsp:option value="<%=opt%>"/>

    -karthik
  • 5. Re: Implementing Shopping cart
    RMishra Journeyer
    Currently Being Moderated
    Hi Karthik,
    In InventroyLookup we are passing sku.repositoryId:
    <dsp:droplet name="/atg/commerce/inventory/InventoryLookup">
    <dsp:param name="itemId" param="Sku.repositoryId"/>
    <dsp:param name="useCache" value="true"/>
    <dsp:oparam name="output">
    Stock Level :<dsp:valueof param="inventoryInfo.availabilityStatusMsg">unknown</dsp:valueof>
    </dsp:oparam>
    </dsp:droplet>

    In below documentation it is given during adding item to order also we are setting sku.repositoryId:
    http://docs.oracle.com/cd/E23095_01/Platform.93/ATGCommStoreGuide/html/s1301addingitemstoshoppingcarts01.html

    Is there any difference between Sku.repositoryId and Sku.id?

    Thanks in advance.
    -RMishra

    Edited by: RMishra on Oct 26, 2012 8:08 PM
  • 6. Re: Implementing Shopping cart
    ClareR Journeyer
    Currently Being Moderated
    Most repository item descriptors shipped with Oracle ATG contain a property descriptor that names the item's ID. Having a named ID property is not a requirement. The repositoryId syntax is provided to allow application code to refer to any item's ID, whether there is a named property or not. When there is a named property, there is no difference between using repositoryId or using the name ("id", in the case of sku).
  • 7. Re: Implementing Shopping cart
    RMishra Journeyer
    Currently Being Moderated
    Thanks Clare.

    -RMishra

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points