6.0.0.2 Get current shopping cart

A client gets current shopping cart for a shopper in a specific store. Before using this service, the client has a reference to the order facade client.

 

Usage scenario

  1. The client calls the order facade client method getCurrentShoppingCart() (memberId and storeId in context).

  2. OrderFacadeClient composes an SDO and calls GetOrder service with XPath query {ibmord.isCurrentShoppingCart=true}/Order access profile WC_OrderDetailsProfile indicates that detail order information are required.

  3. Order component queries the database with the search condition from the XPath.

  4. Order component composes the ShowOrder SDO according to the access profile.

Request

Request BOD GetOrder business object document (BOD)
Schema

Order-DataObjects/xsd/OAGIS/9.0/Overlays/IBM/Commerce/BODs/GetOrder.xsd
Service data object

com.ibm.commerce.order.facade.datatypes.GetOrderType
<soapenv:Envelope
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <soapenv:Header />
        <soapenv:Body>
                <_ord:GetOrder
                       
xmlns:_ord="http://www.ibm.com/xmlns/prod/commerce/9/order"
                       
xmlns:_wcf="http://www.ibm.com/xmlns/prod/commerce/9/foundation"
                       
xmlns:oa="http://www.openapplications.org/oagis/9"
                       
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <oa:ApplicationArea
xsi:type="_wcf:ApplicationAreaType">
                                <oa:CreationDateTime>
                                        2007-01-26T19:25:15.687Z
                                </oa:CreationDateTime>
                                <oa:BODID>
                                       
e4a8fdb0-ad2f-11db-832d-831645b86890
                                </oa:BODID>
                        </oa:ApplicationArea>
                        <_ord:DataArea>
                                <oa:Get>
                                        <oa:Expression
expressionLanguage="wc:XPath">
                                               
{ibmwcf.ap=WC_OrderSummaryProfile;ibmord.is\ShoppingCart=true}/Order
                                        </oa:Expression>
                                </oa:Get>
                        </_ord:DataArea>
                </_ord:GetOrder>
        </soapenv:Body>
</soapenv:Envelope>

 

Response

Post conditions: The response is the ShowOrder BOD containing the current shopping carts with detailed information (order, order item, kit detail information, shipping information, Payment information).

Schema

Order-DataObjects/xsd/OAGIS/9.0/Overlays/IBM/Commerce/BODs/ShowOrder.xsd
Service data object

com.ibm.commerce.order.facade.datatypes.ShowOrderType

The response contains the order information:

 

Sample response BOD

<soapenv:Envelope
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <soapenv:Header />
        <soapenv:Body>
                <_ord:ShowOrder
                       
xmlns:_ord="http://www.ibm.com/xmlns/prod/commerce/9/order"
                       
xmlns:_wcf="http://www.ibm.com/xmlns/prod/commerce/9/foundation"
                       
xmlns:oa="http://www.openapplications.org/oagis/9">
                        <_ord:DataArea>
                                <oa:Show recordSetCount="1"
recordSetStartNumber="0"
                                        recordSetTotal="1" />
                                <_ord:Order
shipAsComplete="true">
                                       
<_ord:OrderIdentifier>
                                               
<_wcf:UniqueID>43141</_wcf:UniqueID>
                                       
</_ord:OrderIdentifier>
                                       
<_ord:StoreIdentifier>
                                               
<_wcf:UniqueID>10001</_wcf:UniqueID>
                                       
</_ord:StoreIdentifier>
                                       
<_ord:BuyerIdentifier>
                                               
<_wcf:UniqueID>-1000</_wcf:UniqueID>
                                               
<_wcf:DistinguishedName>
                                                       
uid=wcsadmin,o=root organization
                                               
</_wcf:DistinguishedName>
                                       
</_ord:BuyerIdentifier>
                                        <_ord:OrderAmount>
                                                <_ord:GrandTotal
currency="USD">
                                                        149.80000
                                               
</_ord:GrandTotal>
                                               
<_ord:TotalProductPrice currency="USD">
                                                        187.25000
                                               
</_ord:TotalProductPrice>
                                               
<_ord:TotalAdjustment currency="USD">
                                                        -37.45000
                                               
</_ord:TotalAdjustment>
                                               
<_ord:Adjustment>
                                                       
<_ord:Usage>Discount</_ord:Usage>
                                                       
<_ord:Code>
                                                               
Brake Pads Category Discount
                                                       
</_ord:Code>
                                                       
<_ord:Description language="-1">
                                                               
Save 20% on all Brake Pads!
                                                       
</_ord:Description>
                                                       
<_ord:Amount currency="USD">
                                                               
-37.45000
                                                       
</_ord:Amount>
                                                       
<_ord:DisplayLevel>
                                                               
OrderItem
                                                       
</_ord:DisplayLevel>
                                               
</_ord:Adjustment>
                                               
<_ord:TotalShippingCharge currency="USD">
                                                        0.00000
                                               
</_ord:TotalShippingCharge>
                                               
<_ord:TotalSalesTax currency="USD">
                                                        0.00000
                                               
</_ord:TotalSalesTax>
                                               
<_ord:TotalShippingTax currency="USD">
                                                        0.00000
                                               
</_ord:TotalShippingTax>
                                        </_ord:OrderAmount>
                                        <_ord:OrderPaymentInfo
/>
                                        <_ord:OrderStatus
prepareIndicator="false">
                                               
<_ord:Status>P</_ord:Status>
                                        </_ord:OrderStatus>
                                        <_ord:LastUpdateDate>
                                               
2007-01-26T11:25:04.078Z
                                       
</_ord:LastUpdateDate>
                                </_ord:Order>
                        </_ord:DataArea>
                </_ord:ShowOrder>
        </soapenv:Body>
</soapenv:Envelope>

 

Exceptions

If there is something wrong with the parameter, the Order component fails to get the shopping cart. The Order component responds with a ShowOrder BOD with ChangeStatus, which indicates that the action failed.

See the exception conditions for ResolveOrdersCmd.

 

Customization

The following extensions are supported:

Related concepts

Service Data Objects (SDO)


Related Reference


WebSphere Commerce services
Order services