Hello, does anyone know how I can access the value...
# replo-help
m
Hello, does anyone know how I can access the value of the currently selected selling plan set by Replo in my own JS? https://support.replo.app/articles/1716416054-subscriptions-and-selling-plans
s
Hi @Mark Burrell, interested in if the broader community knows anything here. The more context you can provide here the better, see our new shiny Guidelines 🙂, but I have a few questions to follow-up on. > the value of the currently selected selling plan What do you mean by "value" here? Do you mean the price? The
id
? Also, can you expand a bit more on the use-case here? We have lots of functionality built into Replo around selling plans so perhaps there is a non-JS approach we could help find.
m
Hi @Steve (Replo Team) - Thanks for the help and info, I'll check the guidelines. I'm interested in finding the currently selected selling plan id. As for our use case, we have an existing JS framework that we use on our site and we hook this functionality up to a Replo page by adding click handlers to the specified elements. In this particular case, the function that will be executed on element click needs to know what selling plan the user has selected on the Replo page.
I'm sure Replo has a lot of the functionality we would need to implement this directly within Replo, however, we would need to rewrite a lot of the logic in our current Shopify theme so that it works in Replo.
n
Hey @Mark Burrell, just synced up with @Matt McAlister (Replo Team) on this — each product container has a form element which you should be able to look at to get various details about the currently selected form values. I updated our documentation here about it - https://support.replo.app/articles/1799213363-custom-development-with-replo#product-form-data-9
however, this doesn't actually support the selling plan id right now, but should be very easy to add. We'll let you know when this is updated!
m
Hey @Noah Gilmore, that sounds good. I'll read the docs and look for the selling plan id on the form element in the future. Thanks!
p
@Mark Burrell just checking in you here! Did you get this sorted or it still an issue?
m
@Steve (Replo Team) at the time, we ended up going with a workaround to set the selling plan when adding to cart. For now, I'd say we've got it sorted out and there's no issue. Of course, this might be good to have in the future. Per Noah's comment above, I was waiting to hear back from Noah/Matt/team on when the selling plan id had been added to the component.
n
ah damn, forgot to follow up! The selling plan id is now part of the form you mentioned - it's key is
selling_plan
and it's a hidden input in the form, same as the other values we discussed
I updated https://support.replo.app/articles/1799213363-custom-development-with-replo#product-form-data-9 to reflect this as well! My bad, didn't realize yall were waiting on this!
m
all good, thanks for adding this in! I'll be sure to use this the next time I need access to that data point.