1

I'm trying to get the cart products json object in the CheckOut page from the web page side. I see there's a dw.order property in the documentation but when inspecting the dw object using the web inspector, I cannot see such order property.

Is there any other object that I can use to get the order products in this checkout page?

I'm using a site like this https://zzrf-001.sandbox.us01.dx.commercecloud.salesforce.com/s/RefArch/home?lang=en_US

BTW, the dw object contains this property:

{
"ac": {
    "_analytics": {},
    "_events": [],
    "_category": "",
    "_searchData": "",
    "_anact": null,
    "_anact_nohit_tag": "",
    "_analytics_enabled": "false",
    "_timeZone": "Etc/UTC",
    "EV_PRD_SEARCHHIT": "searchhit",
    "EV_PRD_DETAIL": "detail",
    "EV_PRD_RECOMMENDATION": "recommendation",
    "EV_PRD_SETPRODUCT": "setproduct"
},
"__dwAnalyticsLoaded": true,
"__dwAnalytics": {}

}

Thanks

3
  • Hello Mario - I assume this is B2C commerce, no? I believe it would be good to post this detail (B2C or B2B classic or B2B Lightning) and the steps on your checkout, maybe it has not come to the point of creating the order. Commented Sep 14, 2021 at 9:12
  • B2C. Yes, the order is not created yet. However, once it is, I don't see any order property in the dw object
    – mario ruiz
    Commented Sep 14, 2021 at 13:43
  • Hi Mario - I'm not familiar with B2C, so I suggest you add the reference to the documentation you are mentioning on the question. This may help others to help you out. Commented Sep 15, 2021 at 8:19

1 Answer 1

2

To get access to the current basket, you can use the BasketMgr:

https://documentation.b2c.commercecloud.salesforce.com/DOC1/topic/com.demandware.dochelp/DWAPI/scriptapi/html/api/class_dw_order_BasketMgr.html#dw_order_BasketMgr_getCurrentOrNewBasket_DetailAnchor

The basket contains the products (and all other information).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .