Preconditions for Calling the AddToCart Method

  • Where AddToCart can be called. This method can be called from either an applet or a business component. In each case, the caller function needs to call the SetBusComp method to set the current business component to the Shopping Service instance.

    The Shopping Service instance needs to use the current business component to get the current business object and all the context information. Therefore, you cannot invoke this method from an applet that does not have a business component.

  • Quote record. The Shopping Cart is just a quote record whose row ID equals the CurrentQuoteId profile attribute. The Quote Type field value for this current quote record can be Quotation, Persistent Cart, or Anonymous Quote.

    • If it is Quotation, then the current quote is a normal quote.

    • If it is Persistent Cart, it means this application supports the Persistent Shopping Cart and this quote is the Persistent Shopping Cart for that user.

    • If it is Anonymous Quote, it means this application allows anonymous users to add items to the Shopping Cart and this user is an anonymous user.

  • Price List Id, Promotion Id, and Campaign Id fields. The current quote record has a Price List Id field, a Promotion Id field, and a Campaign Id field. The field value for Price List Id cannot be empty. The field values for Promotion Id and Campaign Id can be empty or not.

    There are also three corresponding profile attributes—PromotionId, CampaignId, and PriceListId. These can be set by Siebel eMarketing when a user clicks the hyperlink on a Web offer. Therefore, the field values for Price List Id, Campaign Id, and Promotion Id in the current quote record can be different from the values in the PriceListId, CampaignId, and PromotionId profile attributes. When users add items to the Shopping Cart, these three field values in the current quote record are set to the value from the corresponding profile attributes.

  • Internal Product by Price List Optional business component. This is the underlying product business component for AddToCart, QuickAdd, and Customize.

    All other business components use this business component as the proxy business component for AddToCart. This is because only this business component has extended attribute child business components such as Product XA VBC and XA Attribute Value. In addition, it is used in Attribute Adjustments.

    The user properties for the Internal Product by Price List Optional business component are listed in the following table.

    Name Value Explanation

    Field:Base Price

    Catalog Price

    The C++ code for the Shopping Service and Attribute Adjustments refers to certain fields. Instead of hard-coding the field name in C++, this user property is used for mapping between the field to which the C++ code refers and the actual field name in the business component.

    For example, this user property indicates that the Base Price to which the C++ code refers is called Catalog Price in the Internal Product by the Price List Optional business component.

    This way, Base Price in the C++ code can be mapped to different fields in different business components.

    Field:Catalog Price

    Catalog Price

    Similar to Field:Base Price. Used in Attribute Adjustments.

    Field:Reference Price

    Reference Price

    Similar to Field:Base Price. Used in Attribute Adjustments.

    Field:Price Book Id

    Price Book Id

    Similar to Field:Base Price. Used in Attribute Adjustments.

    Field:Promotional Price

    Promotional Price

    Similar to Field:Base Price. Used in Attribute Adjustments.

    Field:Quantity

    Quantity

    Similar to Field:Base Price. Refers to the Quantity field. Used in Attribute Adjustments and in the Shopping Service.

    Field:Your Price

    Your Price

    Similar to Field:Base Price. Used in Attribute Adjustments.

    Product XA

    Product XA VBC

    Indicates that the extended attribute to use is Product XA VBC.

    SetPriceListSearch

    Y

    Indicates that the [Price List Id] = GetProfileAttr(“PriceListId”) search specification should be applied to the business component.

    If used, only products that are on the current price list are visible in Siebel eSales.

    Use Promotional Price

    Y

    Used in Attribute Adjustments.

    When this is Y, the Base Price equals the Promotional Price if the Promotional Price field is not empty. Otherwise, the Base Price equals the Reference Price.

  • AddToCartAutoQuote input argument. When there is no current quote as specified by CurrentQuoteId, AddToCart decides whether to create a new quote automatically based on certain conditions:

    • AddToCart checks the AddToCartAutoQuote input argument. If its value is Y or TRUE, AddToCart automatically creates a new quote. If its value is N or FALSE, AddToCart does not automatically create a new quote.

    • If the AddToCartAutoQuote input argument is empty, AddToCart checks the AddToCartAutoQuote server component parameter (See the following table.)

  • AddToCartGotoView input argument. The calling action can also specify the next view to which to navigate after finishing the AddToCart method. This is done through the AddToCartGotoView input argument:

    • If this input is not empty, the application navigates to the specified view.

    • If this input is empty, the Shopping Service looks for the AddToCartGotoView server component parameter as defined for InfraShoppingService in the repository (See the following table.)

  • Server component parameters. The server component parameters used by the Shopping Service business service are listed in the following table. You can change these parameters by navigating to Server Administration > Components > Component Parameters.

Name Default Value Explanation

AddToCartAutoQuote

TRUE

The value can be TRUE or FALSE.

If it is TRUE, AddToCart automatically creates a new quote if there is no current quote.

AddToCartGotoView

NONE

The value can be NONE or a specific view name.

If it is a specific view name, the application navigates the user to that view after finishing the AddToCart method.

AnonymousQuote

TRUE

The value can be TRUE or FALSE.

If it is TRUE, AddToCart allows anonymous users to add items to the Shopping Cart, and it creates quotes with quote type Anonymous Quote.

If it is FALSE, AddToCart does not allow anonymous users to add items to the Shopping Cart.

AutoQuoteDefaultOwner

TRUE

The value can be TRUE or FALSE.

If it is TRUE, when AddToCart automatically creates a new quote, it automatically fills in the Contact Id and Account Id fields with the current user's login ID and account ID.

PersistentShoppingCart

FALSE

The value can be TRUE or FALSE.

If it is TRUE, the application supports the Persistent Shopping Cart. The quote created by AddToCart will have type Persistent Cart.

When the user logs in to the application, the run-time event triggers the eSales Web Login Action Set. The SetShoppingCart method in that action set loads the quote with type Persistent Cart for that user.

ProductDetailView

Product Detail - Features View (eSales)

Specifies the view name for the Product Detail view.

ShoppingCartView

NONE

Specifies the view for the Shopping Cart.

  • Business object must include all necessary business components. The list of business components that must be in the business object calling the AddToCart method is shown in the following table, using the Catalog business object as an example.

    Business Component Link Comment

    Internal Product by Price List Optional

    None

    Underlying business component for AddToCart, QuickAdd, and Customize.

    All other business components by default use this business component as the AddToCart Proxy Buscomp.

    Internal Product by Price List Optional 2

    Catalog Category/Internal Product by Price List Optional 2

    Used in the Product list applet for AddToCart.

    This business component uses Internal Product by Price List Optional as the AddToCart Proxy Buscomp.

    XA Attribute Value

    Internal Product by Price List Optional/XA Attribute Value

    Needed for extended attributes.

    Product XA VBC

    None

    Needed for extended attributes.

    Product XA VBC Form

    Internal Product by Price List Optional/Product XA VBC Form

    Needed for extended attributes.

    Quote

    None None

    Quote Item

    Quote/Quote Item

    None

    Quote Item XA

    None None

    Training Class Registration

    None

    Needed for AddTrainingItem.

    eEvents Event Attendee

    None

    Needed for AddTrainingItem.

    eEvents Session Attendee

    None

    Needed for AddTrainingItem.

    Favorite List

    None

    Needed for AddToFavoriteList.

    Favorite List Item

    Favorite List/Favorite List Item

    Needed for AddToFavoriteList.