Automatic Role Swop on VX Pricing Widget

  • Posted 7 months ago

I’m having a similar issue to that described in this ticket: https://getvoxel.io/questions/role-issue/

My issue is as follows:

Have a Subscriber (someone who views the site, no plans with this role) and a Provider (a business who picks a paid plan). I have a “list now”/landing page (provider pricing page) where I have the VX pricing widget. I have made two separate auth pages and added the script (see ticket below) to make sure that the pricing widget links to the provider auth page. All other registration/sign up buttons link to the standard subscriber auth page. The problem is that if someone signs up as a subscriber but then wants to change to a provider, they would do so through the “list now”/landing page (provider pricing page). When a subscriber clicks to purchase, they get a pop-up notifying them that this is not supported by this role. This works if they click configure plan and select changed role because the url gets the parameter “?switch_to_role=provider”.

In short, the only solution I could come up with is adding a script (similar to the ticket below) that could append the “?switch_to_role=provider” to the “Pick Plan” button if the current user has role “Subscriber”.

Would you be able to assist with that? Or a better solution to the above? 🙂

Similar to that done in this ticket: https://getvoxel.io/questions/changing-the-link-of-the-pick-plan-button/