Unable to Retrieve Values from Context Variable | Community
Skip to main content
February 8, 2024
Solved

Unable to Retrieve Values from Context Variable

  • February 8, 2024
  • 2 replies
  • 642 views

Hi Team ,
I have an array on my website that will hold several values when a user clicks the "add to cart" button. I have also created a context variable to set the values from the array, but during execution, I was unable to obtain the values from the context variable

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Manoj_Kumar

Hello @sarjoon 

 

Try changing setValue code to this:

document.controller.setValue("/ctx/vars/cartData",cartItems); console.log(document.controller.getValue("/ctx/vars/cartData"))

 

2 replies

Manoj_Kumar
Community Advisor
Manoj_KumarCommunity AdvisorAccepted solution
Community Advisor
February 12, 2024

Hello @sarjoon 

 

Try changing setValue code to this:

document.controller.setValue("/ctx/vars/cartData",cartItems); console.log(document.controller.getValue("/ctx/vars/cartData"))

 

Manoj  | https://themartech.pro
Sukrity_Wadhwa
Community Manager
Community Manager
February 27, 2024

Hi @sarjoon,

Were you able to resolve this query on your own or do you still need help here? Do let us know.

Thanks!

Sukrity Wadhwa