Siebel eSales Administration Guide > Shopping Service Methods Reference > Siebel eSales User Action Methods >

SetShoppingCart Method


This method is used in run-time event action sets to support the Persistent Shopping Cart and anonymous users adding items to the Shopping Cart.

SetShoppingCart is used in the eSales WebLogin Action Set. This action set is associated with the WebLogin run-time event for the Siebel eSales application object. When a Siebel eSales user logs in, the WebLogin run-time event is triggered. This in turn triggers the eSales Web Login Action Set and executes the SetShoppingCart method.

The method checks if there is already a current quote in the session as indicated by the CurrentQuoteId profile attribute:

  • If this profile attribute is empty, it determines if there is any quote of type Persistent Cart associated with the user. If there is one, it loads that quote and sets the CurrentQuoteId profile attribute to that quote ID.
  • If CurrentQuoteId is already set, it checks if the quote type is Anonymous Quote and converts it to Persistent Cart if it is.

Preconditions for Calling the SetShoppingCart Method

  • The following server component parameters must be set to TRUE:
    • PersistentShoppingCart
    • AnonymousQuote
  • To use this method, you need to create an action set with an action that invokes this method. For example, the actions in the eSales Web Login Action Set are shown in Table 22.
    Table 22. eSales Web Login Action Set Actions
    Action
    Business Service
    InvokeMethod

    SetPriceList

    Pricing Manager

    SetPriceList

    SetShoppingCart

    Shopping Service

    SetShoppingCart

    After that, you need to associate this action set with the WebLogin run-time event for the application. The following applications use the eSales WebLogin Action Set:

    • Siebel Partner Relationship Management
    • Siebel eCustomer
    • Siebel eSales

Arguments for the SetShoppingCart Method

None.

Pseudo-Algorithm for SetShoppingCart

  1. If the Is Anonymous profile attribute = TRUE, End.
  2. Check the CurrentQuoteId profile attribute:

    If empty or = EMPTY_CART, there is no current quote. Go to step 3;

    Else go to step 4.

  3. Get the Catalog business object and the Quote, Quote Item, and Quote Item XA business components. Query the Quote business component with the search specification [Contact Id] = LoginId () AND [Quote Type] = LookupValue ('QUOTE_TYPE', 'Persistent Cart') to find the quote record of type Persistent Cart for that user. One or zero records will be returned.

    If one record is returned, the user has a Persistent Cart. Set the CurrentQuoteId profile attribute to the record ID, then go to step 8.

  4. Get the Catalog business object and the Quote, Quote Item, and Quote Item XA business components. Query the Quote business component with the search specification [Id] = GetProfileAttr("CurrentQuoteId") to get the current quote. Check the Quote Type field value:

    If [Quote Type]= LookupValue ('QUOTE_TYPE', 'Anonymous Quote'), the current quote is an anonymous user's Shopping Cart. Go to step 5;

    Else, go to step 6.

  5. Before converting Anonymous Quote to Persistent Cart, it is necessary to check if the user already has a Persistent Shopping Cart. Get a second instance of the Catalog business object and the Quote, Quote Item, and Quote Item XA business components. Query the second instance of the Quote business component with the search specification [Contact Id] = LoginId () AND [Quote Type] = LookupValue ('QUOTE_TYPE', 'Persistent Cart'). It will return one or zero records.

    If it returns no records, go to step 6;

    If it returns one record, it is necessary to resolve the conflict between the anonymous quote and an existing persistent Shopping Cart. Go to step 7.

  6. Convert Anonymous Quote to Persistent Cart:

    Set [Account Id] to the account ID of the current user;

    Set [Contact Id] to the login ID of the current user;

    Set [Quote Type] to LookupValue ('QUOTE_TYPE', 'Persistent Cart');

    Set [Price List Id] to the current price list ID;

    End.

  7. There are two quote records: the quote record in the first Quote instance is the Anonymous Quote; the record in the second Quote instance is the previous Persistent Shopping Cart. Save the previous Persistent Shopping Cart as a quote with a name.
  8. If the price list in the current quote is different from the current price list, set [Price List Id] to the current price list ID in the system.
Siebel eSales Administration Guide Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.