Wednesday, December 31, 2014

BCC Snapshot ID is not Valid: ATG

BCC Snapshot ID is not Valid










Solution:

1. This issue will arise when you try to force the invalid snapshot id, or deleted snapshot id, Try to delete all the deployment tables and start the server.

Note: Dont create snapshot id's manually on deployment tables, it wont work, 











Bcc Transport UnInstantiated Issue : ATG

BCC Transport UnInstantiated Issue:




Transport UnInstantiated Issue





Solution:

1. This issue will occurs when your agent server is down, also check the port configuration of the agent whether it is rightly configured or not.

2. Restart your Agent server will fix this issue,




Sunday, November 30, 2014

BCC issues : ATG BCC


1.  fileMarker cause NullPointerException



**** Error    Thu Nov 27 19:53:23 IST 2014    1417098203972    /atg/deployment/DeploymentManager     item = fileMarker:mark600001 cause = java.lang.NullPointerException
**** Error    Thu Nov 27 19:53:23 IST 2014    1417098203972    /atg/deployment/DeploymentManager        at atg.epub.file.VersionFilePropertyDescriptor.verifyLatestFileVersion(VersionFilePropertyDescriptor.java:353)
**** Error    Thu Nov 27 19:53:23 IST 2014    1417098203972    /atg/deployment/DeploymentManager        at atg.epub.file.VersionFilePropertyDescriptor.getPropertyValue(VersionFilePropertyDescriptor.java:205)





Solution:

Delete all your epub datas and import it again, This issue will arise missing of some required data's, Check your epub tables and if you know the exact value you can directly put that into required tables if not then enable logDebug=true for your repository and DeploymentManager component and find out the table which causing this exception.




2. GSAInvalidatorService java.rmi.server.ExportException




**** Error    Thu Nov 27 20:28:06 IST 2014    1417100286825    /    Unable to create class atg.adapter.gsa.invalidator.GSAInvalidatorService for configuration /atg/dynamo/service/GSAInvalidatorService java.rmi.server.ExportException: Port already in use: 0; nested exception is:
**** Error    Thu Nov 27 20:28:06 IST 2014    1417100286825    /        java.net.BindException: Address already in use: JVM_Bind    java.rmi.server.ExportException: Port already in use: 0; nested exception is:
**** Error    Thu Nov 27 20:28:06 IST 2014    1417100286825    /        java.net.BindException: Address already in use: JVM_Bind
**** Error    Thu Nov 27 20:28:06 IST 2014    1417100286825    /        at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:310)



Solution:

This issues will arise when your agent server is down. or it is not started properly, Check your agent server, Whether it is in disabled mode or not. if it is enable mode and also this issue arise, it is because of port issue. you should check the lockserver ports and then pointing to these into valid port which is not used before,



Friday, October 31, 2014

Difference between Dynamic vs Static Pricing : ATG

 

Difference between Dynamic vs Static Product Pricing


Static pricing :


1. There is a property called listPrice in each item in catalog repository, Commerce Pricing services 
    are using this price as a base price for calculating the order prices, (Shipping, total, tax etc),

2. It is sku based pricing, it uses the pricelist components

3. We can use static pricing on where static prices are required. Not so many places where we can use
    this. only few areas static prices are used nowa days

Dynamic Pricing :


1. These prices are normally coming from external services which reach the repository through
    Programming API's, It will dynamically changing the prices on different conditions with the help 
    of programmatic approach,

2. It is also a sku based pricing, it uses the pricelist components and site configuration components,

3. Dynamic pricing can cause a significant decreases in performance compared to using static    
    pricing. Many sites do not need to show dynamic pricing on product pages; it may be sufficient to 
    show dynamic prices only when a customer places items in the shopping cart,

4. Example: suppose you send a specific group of customers a coupon for 20oRs off all blue items. 
    On the product pages of the site, blue items appear with their static list or sale price, which is the 
    same for all customers. However, when a customer with the “200Rs off” coupon adds a blue item 
    to his or her shopping cart, dynamic pricing takes effect, and the item price appears on the 
    Shopping Cart or Checkout page (for example) with a discount of 200Rs.

5. We can use dynamic pricing on certain product templates

6. Dynamic pricing will provides the high level of performance by using the pricing features 
    selectively.







Tuesday, September 30, 2014

Create Promotion Template and Add ClosenessQualifier : ATG

 

Steps:

 

1. Create Screen-Segments with ,

<screen-segment display-name-resource="closenessQualifierTitle" ></screen-segment>,


2. Add display-once=true to screen-segments, because it should be mandatory for all the templates.

<screen-segment display-name-resource="closenessQualifierTitle"
 display-once="true"></screen-segment>,


3. Have one or more line elements for Closeness Qualifier information.


 <line>
      <label id="amountToSpend"
             display-name="Amount to spend:"/>
      <textInput id="textId${inc}" placeholder-name="myAmount"/>
   </line>



 Finally it looks like:


<screen-segment display-name-resource="closenessQualifierTitle" 
display-once="true">
   <line>
      <label id="amountToSpend"
             display-name="Amount to spend:"/>
      <textInput id="textId${inc}" placeholder-name="myAmount"/>
   </line>
</screen-segment>



3. Create a Promotion (Upsell) in ACC/BCC (eg: When spending limit crosses $2000, Then that customer is eligible for free shipping ).


4. Create item-properties section which will including PMDL Rule,


Note: There should be only one <item-properties> for each and every screen segment.


<item-properties>
  <property name="closenessQualifiers">

  <item-properties>
    <property name="pmdlRule">
      <![CDATA[
  <pricing-model>
    <qualifier>
      <comparator name="greater-than-or-equals">
        <value>order.priceInfo.amount</value>
        <constant>
          <data-type>java.lang.Double</data-type>
          <string-value> ${myAmount} </string-value>
        </constant>
      </comparator>
    </qualifier>
  </pricing-model>
  ]]>
</property>
  </item-properties>
</property>
</item-properties




5. Comparator name "greater-than-or-equals"  will give you a exact result when spending limit crosses $2000 it allowing the new promotions to be display in the application.


6. Note : When we are creating PMDL rule then we should have
 <property name="closenessQualifiers">  under item-property tag.


7. Spend around $2000 and see the application, Now you could see the free shipping available on your application (Note: you must create shipping flags for displaying free shipping messages)


8. That's it.









Saturday, August 30, 2014

Disabling the Gift List In ATG


Steps:


Go to --> /atg/registry/ContentRepositories component and remove the value in the initialRepositories property that references the /atg/commerce/gifts/Giftlist component.

Go to --> /atg/commerce/gifts/GiftlistTools component and set the giftlistRepository property to null.

Go to --> userProfile.xml file and remove properties that reference items in the Giftlists repository. The userProfile.xml file is located in the Commerce configuration layer. Remove the following tables.
    1. dcs_user_wishlist
    2. dcs_user_giftlist
    3. dcs_user_otherlist

eg:

Remove below repository entries

<!-- key into private wishlist -->
<table name="dcs_user_wishlist" type="auxiliary"
id-column-name="user_id">
  <property category="Commerce - Lists" name="wishlist"
            item-type="gift-list"
            repository="/atg/commerce/gifts/Giftlists"
            column-name="giftlist_id"cascade="insert,update,delete"
            display-name="Wish list"/>
</table>


<!-- key into user created giftlists -->
<table name="dcs_user_giftlist" type="multi"
id-column-name="user_id" multi-column-name="sequence_num">
  <property category="Commerce - Lists" name="giftlists"
            data-type="list" component-item-type="gift-list"
            repository="/atg/commerce/gifts/Giftlists"
            column-name="giftlist_id" display-name="Gift list"/>
</table>


<!-- key into giftlists found for other customers -->
<table name="dcs_user_otherlist" type="multi"
id-column-name="user_id" multi-column-name="sequence_num">
  <property category="Commerce - Lists" name="otherGiftlists"
            data-type="list" component-item-type="gift-list"
            repository="/atg/commerce/gifts/Giftlists"
            column-name="giftlist_id"
            display-name="Other gift lists"/>
</table>


Go to -->  updateGiftRepository and sendGiftPurchased processors from the commerce pipeline and Remove these processors . These processors are found in the processOrder pipeline chain. After these entries have been removed from the chain definition, create a link from the authorizePayment processor to the addOrderToRepository processor.

Thats it, Gift list has been disabled permanently in your application.





ATG - Endeca Integration Architecture Diagram


Thursday, July 31, 2014

Product Comparison Simple Analysis : ATG

 

 

Product Comparison:



 Product Comparison provides the ability to compare the products in the catalog.

 A simple site may offer the user a single product comparison list and enable the user to add and remove products from the list, as well as compare the properties of the products in the list. A more complex site may offer the user multiple comparison lists to compare different types of items (for example, one list to compare funitures, a different list to compare mobiles, and so on).



Components Involved:


1. /atg/commerce/catalog/comparison/ProductList
2. /atg/commerce/catalog/comparison/ProductListContains.
3. /atg/commerce/catalog/comparison/ProductListHandler
4. /atg/commerce/catalog/comparison/ProductComparisonList


ProductList:


1. The items property of the ProductList component stores the list of Entry objects that represent each product in the product comparison list
2. Each Entry object in the ProductList combines category, product, SKU, and inventory information in a single object,
3. A unique ID that names the list entry. You can use this property to retrieve individual entries by calling

<dsp:valueof bean="ProductList.entries[id]"/>


ProductComparisonList:


1. It is a session scoped component located in nucleus,
2. To manage multiple comparison lists (for eg: list to compare mobiles, list to compare  TV's) we can use ProductComparisonList,
3. ProductComparisonList provides some convenience methods like sortProperties and tableColumns that call through to the referenced TableInfo object,
4. ProductList.tableColumns is equivalent to the expression ProductList.tableInfo.tableColumns, you can use either of it.

Example:

   <dsp:param bean="ProductList.tableColumns" name="array"/>
   <dsp:param value="" name="sortProperties"/>




JSP Code Snippet for ProductComparisonList

<dsp:droplet name="ForEach">
  <dsp:param bean="ProductComparisonList.items" name="array"/>
  <dsp:oparam name="output">
    <p>Product Name: 

      <dsp:valueof param="element.product.displayName"/><br>
       Category: 

      <dsp:valueof param="element.category.displayName"/><br>
       Inventory: <dsp:valueof param="element.inventoryInfo.inventoryAvailabilityMsg"/><br>
  </dsp:oparam>
</dsp:droplet>




ProductListContains:


1. It is a global scope component located in nucleus,
2. The very good advantage of using ProductListContains if you dont specify a categoryId for a given product, then ProductListContains checks the list of entry
   whose category matches either the given products default category or if there is no category for the given product (null), we can blindly go with this component,



ProductListHandler:


1. It is a request scope component located in nucleus,
2. This component is used for setting the forms and submitting the forms,
3. This component will provide you the very flexible way of adding and removing the products to the comparison list.

Example:

<dsp:input bean="ProductListHandler.addProductList" value="Add to list"  type="submit"/>

<dsp:input bean="ProductListHandler.removeEntries" value="Remove selected  items" type="submit"/>


<dsp:input bean="ProductListHandler.clearList" value="Remove all" type="submit"/>




Note:
Previously /atg/commerce/catalog/SearchFormHandler has been used for providing the search result for product comparison list.

Example :  <dsp:param bean="SearchFormHandler.searchResults" name="array"/>

Nowa days Oracle Endeca is providing some search component for more flexible way of providing the search results.



Monday, June 30, 2014

OOTB Promotions : ATG


OOTB Promotions :


  • Specific amount off a particular product
  • Percentage amount off a whole order
  • Specific amount or percentage off a product based on an attribute
  • Free shipping for a specific product
  • Buy one, get one free
  • Free gift with purchase



Adding a new discount type involves the following tasks:


  1. Extend or create a calculator that supports the discount type.
  2. Modify the CalculatorInfo object to include the new discount type and calculator information.
The PMDL uses the CalculatorInfo to identify which calculator to use.


You can determine the promotion type by checking if its item descriptor is a subtype of the base item, shipping, and order discount item descriptors: 



if (((GSAItemDescriptor) pricingModel.getItemDescriptor()).isSubTypeOf("Item Discount"))

   List qualifyingItems = qualifierService.findQualifyingItems(...params..);






Thursday, May 22, 2014

Creating a New Pricing Engine : ATG

Creating a New Pricing Engine

 


If you want to create a new pricing engine that prices Sample costs separately from shipping. You create a SamplePricingEngine that acts independently of the ShippingPricingEngine.
 

 
  • Create an interface called SamplePricingEngine that extends PricingEngine.


  • Create an implementation called SamplePricingEngineImpl that extends PricingEngineService.


  • Create a SamplePricingInfo that extends the  atg.commerce.pricing.AmountInfo price holding class.


  • Create a calculator called SamplePricingCalculator and implementations of it that calculate and discount Sample as your business requires.


  • Modify the Promotions repository definition file (by default, pricingModels.xml). Add an item-descriptor for the Sample discount type and sub-descriptors for the various implementations of the SamplePricingCalculator that you created.


  • Create properties files for the SamplePricingEngine and each of the calculators.


  • Your engine is ready for use. You may also want to add preCalculators that calculate the base cost of Sample.



Sunday, April 20, 2014

Item Caches and Query Caches : ATG Repository



Each item descriptor in a SQL repository has its own separate item cache and query cache. This lets you size and flush caches separately for separate item types. The item cache holds property values for repository items. It is indexed by the repository item IDs. The query cache holds the repository IDs of items that match particular queries in the cache.


For example, suppose you have a query like this:


color = red AND size = XXL

If query caching is enabled, the first time this query is issued, the result set is retrieved from the database and stored in the query cache. Then, the next time this same query is issued, the SQL repository can retrieve the result set from the cache, rather than needing to access the database.

The item caches hold the values of repository items. Repository queries are performed in two passes, using two separate SELECT statements. The first statement gathers the IDs of the repository items that match that query. The SQL repository then examines the result set from the first SELECT statement and finds any items that already exist in the item cache. A second SELECT statement retrieves from the database any items that are not in the item cache.

Query caching is turned off by default. If items in your repository are updated frequently, or if repeated queries are not common, you may not receive enough benefit from a query cache to justify the minor amount of overhead in maintaining the cache.


Invalidate the item caches for every item descriptor in a repository:


RepositoryImpl rep = getRepository();
  String[] descriptorNames = getItemDescriptorNames();

// iterate over all the descriptors

for (int i=0; i<descriptorNames.length; i++) {
    String name = descriptorNames[i];
    ItemDescriptorImpl d = (ItemDescriptorImpl)rep.getItemDescriptor(name);
    d.invalidateItemCache();
}


Cache Timeout:


if you set item-expire-timeout to 1000 milliseconds, the SQL repository will reload those properties after they have been in the cache for 1 second. If you set query-expire-timeout to 1000 milliseconds, the SQL repository re-executes the query after that entry has been in the query cache for 1 second.

To use the item-expire-timeout and query-expire-timeout attributes, set the value (in milliseconds) in the item-descriptor tag.


For example:


<item-descriptor name="order" cache-mode="simple"
      item-expire-timeout="180000"
      query-expire-timeout="180000">
...
</item-descriptor>
 



Wednesday, March 5, 2014

What is New in ATG10.2

NEW FEATURES IN ATG 10.2


Site Administration


1. Profile realms provide multisite profile management support

REST Web Services


1. A new extensible REST architecture (the REST MVC Web Services API) is available in addition to the legacy REST API.

ATG Content Administration


1. An extensible asset purge function removes unneeded repository items.

2. Emergency workflows are now available for situations where an emergency project must be updated within minutes, bypassing standard deployment.

Oracle ATG Web Commerce


1. Cross-channel inventory visibility adds in-store pickup functionality, and enhances the current ATG Inventory system to accommodate multiple locations for any given SKU.


Oracle ATG Web Commerce Merchandising


• New roles and access rights help control the content that business users can access in the Business Control Center.

Configurable filters can now restrict how promotions are applied to qualifiers and target items.

• In Oracle ATG Web Merchandising layout view, Promotions Visibility features analyze how promotions behave when preview users shop for items. You can also edit promotions directly from layout view.

Promotions now support non-discountable items.

• The workbench pane that appears at the top of the Merchandising window bookmarks assets for organization and editing. (Previously, the workbench could be used only for Multi Edit operations.)

New UI for working with internal, preview, and external users.

New Store Location assets contain information about physical “brick and mortar” stores, such as addresses and hours.

• The existing rich text editor has been replaced with FCKeditor HTML editor. FCKeditor is installed automatically with the Oracle ATG Web Commerce applications that require it.

• In multisite environments, administrators can limit Merchandising users’ access to catalog assets and promotions based on their site affiliation.

• All personalization items can be configured to use site groups.

Oracle ATG Web Commerce Reference Store


• Updated code to improve checkout performance.

• Example of Oracle ATG Web Commerce returns functionality.

• Optional integration with Oracle RightNow Knowledge Cloud Service, which displays context-sensitive knowledgebase and support information.

• Integration with Oracle Endeca Commerce. All search facilities use Oracle Endeca Commerce and the Commerce Reference Store category pages and search results pages are Endeca-driven.

• A build environment allows you to quickly and easily rebuild the Commerce Reference Store modules using the Apache Ant build tool.


Commerce Reference Store iOS Universal Application


ATG Web Commerce 10.2
includes the first release of the Commerce Reference Store iOS Universal Application (CRS-IUA) that serves both iPhone and iPad.


Oracle ATG Web Commerce Business Intelligence


The following features are new to Oracle ATG Web Commerce Business Intelligence.

Data aggregation to improve reporting performance in the Business Intelligence data warehouse.

• Usability improvements in Business Intelligence reports.

Oracle ATG Web Commerce Service Center


The following features are new to Oracle ATG Web Commerce Service Center.

• Optional integration with Oracle Endeca Commerce for catalog search.

Commerce Service Center can be configured to use in-store pickup, which allows the customer to go to a store near them and pickup the merchandise. Returns with in-store pickup are also supported.

• Support for profile realms, which provide multisite profile management support.

• Optional integration with Oracle Live Help On Demand Click to Call.





Friday, February 28, 2014

Simple Way To Create Payment Group : ATG

 

Creating a Payment Group



A PaymentGroup contain information about the payment method that will be used to purchase a group of commerce items.


1. By default, a new Order has one default PaymentGroup.

2. As items are added to the Order, these items automatically become part of the default      PaymentGroup.

3. Once a second PaymentGroup is added to the Order, all the items in the Order are removed from the default PaymentGroup and must be explicitly added to one of the two payment groups.

4. Relationships must now be created to associate the items with payment groups.

5. Payment groups also contain a requisitionNumber property for orders that require approval before a means of payment can be specified.

6. Orders with requisition numbers are automatically assumed to require approval.



Follow these steps to create a new PaymentGroup and add it to an Order:



1. Call PaymentGroupManager.createPaymentGroup().

2. Make any changes to the PaymentGroup. For example, you could set the credit card number and expiration date.

3. Call PaymentGroupManager.addPaymentGroupToOrder(pOrder, pPaymentGroup) to add the payment group to the order.


Refer to the following example:



// Get a reference to the OrderManager
OrderManager orderManager = (OrderManager)
             request.resolveName("/atg/commerce/order/OrderManager");


// Create the PaymentGroup
PaymentGroup paymentGroup = paymentGroupManager.createPaymentGroup();

// Add the PaymentGroup to the Order
paymentGroupManager.addPaymentGroupToOrder(pOrder, paymentGroup);


Tips For Creating Multiple Payment Groups



1. Multiple payment groups (which implement Multipayment) on a commerce site permit a customer to split the cost of an order by amount and/or items. For example, suppose a customer begins the checkout process on a site that supports multiple payment methods for a single order. The customer chooses to partition payment by putting the first $1000 of a $1250 order on a Visa credit card. The customer then chooses to pay for the remaining $250 using points earned on the site during previous visits.


The following assumptions were made regarding Multipayment:



1. Customers can divide payment for an order or individual items by item quantity, percentage, or amount.

2. Customers can pay for part of a purchase using one payment method and use another payment method for the rest of the purchases.

3. Gift certificates are implemented as payment methods.


Note: The base commerce classes have built-in support for multiple payment methods. Multipayment allows customers to pay for purchases using multiple payment methods. For example, a customer can choose to pay for an order using two or more credit cards and a gift certificate. While customers can select payment methods by item level, amount level, or any combination of the two, you can limit the ways in which an order’s costs can be split, if necessary. The product UI for this component is entirely JSP-based.


Tuesday, February 11, 2014

Simple Way To Create Shipping Group : ATG

Creating Shipping Groups:


A ShippingGroup contains information on the shipping address and delivery method for a group of commerce items.

1. By default, a new Order has one default ShippingGroup.

2. As items are added to the Order, these items automatically become part of the default ShippingGroup.

3. Once a second ShippingGroup is added to the Order, all the items in the Order are removed from the default ShippingGroup and must be explicitly added to one of two shipping groups.

4. Relationships must now be created to associate the items with shipping groups.


Follow these steps to create a new ShippingGroup and add it to an Order:


 1. Call ShippingGroupManager.createShippingGroup().

 2. Make any changes to the ShippingGroup, such as setting the address.

 3. Call ShippingGroupManager.addShippingGroupToOrder(pOrder, pShippingGroup) to add the ShippingGroup to the Order.


Refer to the following example:


// Get a reference to the OrderManager
OrderManager orderManager = (OrderManager)
  request.resolveName("/atg/commerce/order/OrderManager");


// Create the ShippingGroup
ShippingGroup shippingGroup = shippingGroupManager.createShippingGroup();
 
// Add the ShippingGroup to the Order
shippingGroup.addShippingGroupToOrder(pOrder, shippingGroup);


When setting the shipping and billing addresses, normally you pass a RepositoryContactInfo object to setShippingAddress() or setBillingAddress(). If you want to use a ContactInfo object instead, but do not want to subclass RepositoryContactInfo (see defaultShippingGroupAddressType in the OrderTools section), you must modify some Nucleus components. List the properties of your address object in the savedProperties property of /atg/commerce/order/processor/SaveShippingGroupObjects and the loadProperties property of atg/commerce/order/processor/LoadShippingGroupObjects.


Tip For Multiple Shipping Groups   

 

1. Multiple shipping groups (which implement Multishipment) on a commerce site permit a customer to ship parts of an order to different addresses using different methods of delivery.

2. For example, suppose a customer enters the checkout process on a site that supports multiple shipping methods for a single order. The customer chooses to have the items shipped to different locations. The site must provide a UI that allows the customer to enter an address, and then associate it with a shipper, such as UPS or US Postal.

3. After the customer selects a shipper, a ShippingGroup is created. The site must then provide a UI that allows the customer to associate items with that shipping group. If there is only one shipping group, then all the items to be shipped will go into that shipping group. If more than one shipping group is associated with the order, then the customer must decide which items go into each group.






----------------------------------------------------------------------------------------------------------------------------

Thursday, January 16, 2014

Creating a Configurable Commerce Item : ATG



      Configurable commerce items are items with other items as optional components, and are described in the Using and Extending the Standard Catalog chapter of this manual.

Follow these steps to create a new ConfigurableCommerceItem and associate it with an Order:


Call CommerceItemManager.createCommerceItem() to create the base commerce item.

Call CommerceItemManager.addSubItemToConfigurableItem() or addAsSeparateSubItemToConfigurableItem() to add options to the base item.

The example below illustrates how to programmatically create a ConfigurableCommerceItem with subSKU items and then add it to an Order.

Example:


// Creating Configurable CommerceItem
ConfigurableCommerceItem configurableItem = (ConfigurableCommerceItem)
getCommerceItemManager().createCommerceItem("configurableCommerceItem",
 "sku10001", null, "prod10001", null, 1, null, null, new ItemPriceInfo());

SubSkuCommerceItem subskuItem = (SubSkuCommerceItem)
getCommerceItemManager().createCommerceItem("subSkuCommerceItem",
"sku20001", null, "prod20001", null, 1, null, null, new ItemPriceInfo());
getCommerceItemManager().addSubItemToConfigurableItem(configurableItem,
subskuItem);

subskuItem = (SubSkuCommerceItem)
getCommerceItemManager().createCommerceItem("subSkuCommerceItem",
"sku20002", null, "prod20002", null, 1, null, null, new ItemPriceInfo());
getCommerceItemManager().addSubItemToConfigurableItem(configurableItem,
subskuItem);

//Adding Configurable CommerceItem to Order
getCommerceItemManager().addItemToOrder(order, configurableItem);




Creating a Standard Commerce Item : ATG

Follow these steps to create a new CommerceItem and associate it with an Order:

1. Call CommerceItemManager.createCommerceItem().

2. Make any changes to the CommerceItem, such as setting the quantity.

3. Call CommerceItemManager.addItemToOrder(pOrder, pCommerceItem) to add the CommerceItem to       the Order.

Refer to the below example:


// Get a reference to the OrderManager
OrderManager orderManager = (OrderManager)
  request.resolveName("/atg/commerce/order/OrderManager");

// Create the CommerceItem
CommerceItem commerceItem =
  commerceItemManager.createCommerceItem(pCatalogRefId);
commerceItem.setQuantity(3);

// Add the CommerceItem to the Order
commereceItemManager.addItemToOrder(pOrder, commerceItem);


Note: createCommerceItem() will work even if you pass it a nonexistent catalog reference ID. This allows you to use ATG Commerce as an ordering system with multiple catalogs, some of which may not have repositories. If you want to prevent this behavior, you must institute a check.

Auxiliary data is a construct that exists in a CommerceItem object. This structure allows arbitrary data to be stored with a CommerceItem.

This data could be the options for a CommerceItem such as size and color. It could also refer to the product reference in the catalog. An important concept is that any data that is inserted into the auxiliary data can be serialized at any time in a system that contains remote components.

When defining AuxiliaryData objects, the classes must be defined as serializable. As initially defined, the class includes ProductID, ProductRef, PropertyValue, and CatalogRef properties.



Popular Posts