Restrict Wordpress product categories for Discourse VIPs

I’ve temporarily disabled SSO until we figure out how & why is the SSO isn’t working. I’ll set up a sandbox to test this out so that I could rule out any plugin or configuration conflict.

1 Like

@Kodie_Critzer @itsbhanusharma

Here’s a brief about what I’ve implemented.

Essentially I’ve created a webhook via a discourse plugin which fires when a user is added to / removed from a discourse group.

That webhook is processed by the wordpress plugin I’ve created.

The wordpress plugin receives the webhook payload, and creates a WooCommerce Membership using the VIP Products Plan. Also it does so only for the VIP group in discourse.

It uses the email address to match the discourse user to the wp user.

If the membership already exists, it will update its status based on whether the user was added or removed.

Basically, if you change the content restriction settings for the VIP Products plan, it will apply to the users in the VIP group in discourse automatically.

All of this was done to provide complete flexibility on WP side when a user purchases VIP on discourse.

Note: the group_name and plan_id are built into the wordpress plugin. Please make sure not to use another group or another membership plan.

1 Like

Got it. Thank you for the info! Am I able to sell the VIP package on Wordpress and have it add a user to Discourse VIP as well? Or will that functionality not work?

1 Like

@Kodie_Critzer we’ve done such a thing for a client in the past but its opposite of what we did here. It will have to be another task :slight_smile:

1 Like

Thanks for the response. That work isnt necessary right now. Im waiting on a response from @itsbhanusharma to see how we can proceed. Our site login does not work and I am not aware what the root cause of the issue is as this was working a week ago. Our blog authors use this method for logging in on a daily basis and this behavior no longer works.

1 Like

I hope his family is fine and he can be back soon to look at this.
Do check this out @itsbhanusharma when you come back online.

Your sso config should work now. The issue is, there some code in the child theme which generates a sso url and its assumes a certain sso secret key which was the culprit. When @itsbhanusharma updated the config, it broke the code. Nor mine or Bhanu’s work were responsible for the breakage.

The correct way is to get rid of the code and use [discourse_sso_client] shortcode which does the job of generating the correct link irrsespective of your sso secret. You should contact this the dev responsible for writing that code.

1 Like

I think there is a link as well which simon mentioned somewhere on discourse meta (it’s the equivalent of the shortcode with customization possibilities) however, the problem that I’m suspecting here was that the login link was some how set to an existing login token at some point and that caused this to not work?

I received a communication from the dev who customized the theme for kodie and they suggested editing some template in woocommerce to change the login link.

@fzngagan Now that you’ve addressed the login issue, what else is left for me to take care of?

1 Like

I think if you can enable my wp plugin and give a confirmation that everything works as expected, that’s all. You suggested at some point that the logic would need to be tweaked due to sso config?

I think @Kodie_Critzer also asked for some text additions in the discourse-subscriptions plugin which I’m waiting on for him to send over.

1 Like

Hey so sorry I missed this! I have been back at home and took off from work for a bit.

There are a few things that we would like to add:

1- on the subscribe page we want to highlight the value of subscribing to vip please add the text below:
What you get:
-Access to Live Events
-VIP tag on the forum
-Access to view and participate in our podcasts
-Access to exclusive VIP only merch releases
-Random autographs from player alumni

2- on /vip/ could we add a pop up or change the copy from “This page is only available to members.” to “To view this page you must be a Locker Room Access VIP. To subscribe to VIP click here. You will need to create an account on our forum in order to subscribe.”

1 Like

I’ll give you an update on monday

I’ve messaged the team regarding text formatting support for product descriptions. Let’s see how it goes.

Regarding wp copy change, are you familiar with translation plugin such as WPML. They do a good job of text replacement compared to writing custom code.

I’ve submitted a patch to the plugin to support formatted description here.

Thank you @fzngagan. I will download that plug in and see what I can do.

After discussing with my business partner we think it will be extremely valuable if we can sell the membership on the wordpress site as well as discourse. How much would it be to build this so that when a membership is purchased on wordpress it feeds into Discourse and creates a VIP profile?

1 Like

Good news, my changes have been merged into the discourse-subscriptions plugin. Now you’ll be able to format your product description.

Can we close out this task? Are you happy with the work done currently?

I’ll get you a quote for this one.

Thank you! I will check the plugin to update the copy and download the wordpress plugin as well. But yes, we are happy with the work done so far!

1 Like

What is the plugin called? Could you link me to it in discourse please?

1 Like

Everything is setup on your sites. @itsbhanusharma can you give him a demo?
Just make sure to update discourse-subscriptions in order to use markdown for product description.

Sounds good. I found where to add the copy but the formatting is off

Maybe @itsbhanusharma could help with that.

1 Like

Thanks @fzngagan, I’ll get on to this tomorrow @Kodie_Critzer I’ll have a look at it to see what’s failing.