I'm trying to add a custom view to the layout comp...
# suitecommerce
m
I'm trying to add a custom view to the layout component which needs access to some custom properties on the item
custitem_my_prop
. This view will be on the PDP and in the Cart, but I am unsure how to get the item context data
contextRequestData
in the Cart—it's
undefined
. I'm relatively new to SC development so can anyone give me some direction?
e
contextDataRequest
 is a call you can include in a child view so that it will gain access to the model or collection data of a parent view. Probably it is available on the P DP but not in the cart itself based on the docs. Try using the
Cart
component, specifically the
getLines
method. https://system.netsuite.com/help/helpcenter/en_US/APIs/SuiteCommerce/Extensibility/Frontend/Cart.html#getLines
👍 1
m
You know, I thought as much because the table for
contextRequestData
didn't have a Cart parent view listed, but was unsure. Thanks for the advice!
👌 1