7 Replies Latest reply on Oct 27, 2012 9:39 AM by RMishra

    Implementing Shopping cart

      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">
      <tr><td class=box-top-store>Add to Cart</td></tr>
      <tr><td class=box>

      <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:valueof param="Sku.displayName"/>
      <dsp:input bean="CartModifierFormHandler.addItemToOrder"
      value="Add to Cart" type="submit"/>

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

          • 2. Re: Implementing Shopping cart
            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
              <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.
              • 4. Re: Implementing Shopping cart
                karthik chopperla
                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%>"/>

                • 5. Re: Implementing Shopping cart
                  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>

                  In below documentation it is given during adding item to order also we are setting sku.repositoryId:

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

                  Thanks in advance.

                  Edited by: RMishra on Oct 26, 2012 8:08 PM
                  • 6. Re: Implementing Shopping cart
                    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
                      Thanks Clare.