#chief-pricingtable-clientreferenceid
1 messages · Page 1 of 1 (latest)
ok thank you. essentially the 4th to last line in the code block
I just tried and it works totally fine for me
You need to make sure that when you render that HTML it has the real value inside
do you remove the quotes? that would be what i would expect
No, I just did client-reference-id="testing"
and I see that on the resulting Checkout Session
what if i want it to be dynamically set with the current users id on my page. each user has a user id. i would just have to set the value in there rather than the variable?
yes
you need to make sure that the value is set there before you render the html basically
if i can use the variable then it should dynamically set it in there. maybe i have to refactor my code because i am using a tool called bildr. ill have to play with it then…. and it should return the client-id thing back in the url route when i set that client-id thing in the end of the url route… can i also retrieve this value as well? i dont really have hooks available without using third party hooks
everything else i am doing would be straight api call (checking if the subscription is still current, etc)
i guess that isnt really needed if i have the client id already, and im appending that to their user account on my backend
As the developer, you need to render the HTML you shared above with the real value of client-reference-id="{{CLIENT_REFERENCE_ID}}"
you can't use a variable client-side
ok that makes sense. i just have to figure out how to get it in there. i will have to see if i can maybe set an id=“myid” in there or something to be able to push the value into the element in the dom
and then use a querySelector to access it possobly
its complicated. 😅
I don't know what "use a querySelector" could mean but if you have more specific details I'm happy to help
the code is inside a codeblock on my building tool. the only way to pass a value to it that i know of would be to inject it with value = document.QuerySelector(“myId”).innerHTML or something like that
ill mess with it and see what i can come up with. thank you