Hi, I want to access cart contents data like all...
# suitecommerce
k
Hi, I want to access cart contents data like all the items price, name, quantity etc. in sitebuilder itemdrilldown template file. How can I do that? Thanks
d
There's a #CD078NTQD group for things like this - but I don't think you'll be able to do this. Nearest is <%=getCartSummaryHTML()%>.
To get individual line data, you'd need to create a SSP file (Suitescript 1.0 .ss service handler) using the commerce API, then fetch this with jQuery or similar.
Copy code
function service(request, response){
	var order = nlapiGetWebContainer().getShoppingSession().getOrder();
	var orderlines = order.getItems(['name','quantity','amount']);
	response.write(JSON.stringify(orderlines));
}
k
@Dominic B Thanks, it worked.