How to check for a user's plan?

Hello,

I have a page that is only accessible to members who pay for a particular plan. I’m trying to circumvent the ugly “this page is only accessible to subscribers” page by routing them directly to the Plans and Pricing page if they haven’t purchased it yet.

The logic would be to check if they have paid for the plan or not, then:
If they have not paid for it yet, they are redirected to the Plans & Pricing page, which would then have the onPurchase function to send them right back to the paid-only page once they check out.

If they did pay for it, then nothing happens and they continue to access the page as normal.

I’m familiar with code but no expert. I managed to hobble together logic on another page that was checking for whether or not a user had a particular Member Role or not; but I can’t seem to find enough info about this on the forums to move forward with Paid Plans.

Any help is very appreciated —Thanks!

1 Like