cancel
Showing results for 
Search instead for 
Did you mean: 

Shopping cart - runtime data

former_member194668
Active Participant
0 Kudos

Hi All,

We are using ISA on ECC.

How to obtain shopping cart runtime data?

Like how many items are present in the cart, total value, ...

Suppose we are in product catalog page and add an item to the cart, can we get the current shopping cart data?

Thanks and regards

Aarthi

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Aarthi,

It is technically possible to always access almost any business object and the related information in any JSP. The UsersessionData object (which is a session context object) is available in all the JSPs. You can get the metaBOM and get any BO from the BOM. See order.jsp for some sample code to get SalesDocumentHeader from usersession --> BOM --> Order BO (Sales document) --> to header.

You must include appropriate import statements in your JSP. The list below is just an example. Figure out what else you may need.


<%@ page import="com.sapmarkets.isa.businessobject.*" %>
<%@ page import="com.sapmarkets.isa.businessobject.item.*" %>
<%@ page import="com.sapmarkets.isa.businessobject.order.*" %>
<%@ page import="com.sapmarkets.isa.businessobject.header.*" %>

The scriptlet below will give you an idea what needs to be done.

<%
BusinessObjectManager bom = 
  (BusinessObjectManager) userSessionData.getBOM
  (BusinessObjectManager.ISACORE_BOM);
salesDoc = bom.getBasket();
HeaderSalesDocument  header = salesDoc.getHeader();
ItemList items = salesDoc.getItems();
%>

From the size of the items you can determine the actual number of items in the cart.

If you want to know about the Minibasket and how it gets displayed and gets the values (in B2B), see my replies in this

Easwar Ram

http://www.parxlns.com

former_member194668
Active Participant
0 Kudos

Hi Easwar Ram,

I was able to update mini basket value using your approach in order.jsp.

But when it comes to catalog (ProductsISA.jsp or ProductDetailsISA.jsp) then number of items returned is zero. Is there any other way to get the correct number of items?

When i say items.size(), its returning correct number of items in order.jsp, but "0" in ProductsISA.jsp or ProductDetailsISA.jsp.

header.getNetValueWOFreight() is returning the correct price in all the jsps.

Thanks and regards

Aarthi