Is there a way to access item information on the p...
# suitecommerce
r
Is there a way to access item information on the pdp from a child view you've added to it within it's initialize function without passing the item data along during creating/adding it to the pdp layout in the mountToApp function?
k
is there a reason you don't want to pass the data?
p
you can add
Copy code
, contextDataRequest: ['item']
as a property of the view. with that you'll have the item property available in the context to be used with
Copy code
this.contextData.item()
(it's used in PLP here but same concept applies on PDP)
r
Thank you for the help.
@Kearobi - I couldn't pass the data because I add the view when the mountToApp is first called from the PLP. I don't have the specific data to pass that is specific to the PDP I navigate to.
👍 1
@PabloZ I was able to get the item data in the getContext method, thanks
p
awesome !