Skip Navigation

[Resolved] Subscription website / different listing pages

This support ticket is created 2 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 2 voices.

Last updated by Minesh 2 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#2623213

Hello,

I'm building a directory website, and the clients will be able to add their listing by choosing between 3 packages: Free, Standard, Premium. I plan on using WooCommerce Subscription to achieve that.

Each package will show different fields on the frontend, ie. Free Listings will show only the basic info (ex. 4 of 10 custom fields), Standard Listing should display a bit more (ex. 7 of 10 custom fields) and the Premium Listing will show all the fields. Also, I want to have a sidebar on the right side, for the Standard and Premium there will be a contact form, and for free listing will be AD (all created in elementor).

I created a products (Free, Standard, Premium), and I was able to connect Post Form for each, but I'm still searching for the best solution regarding the preview of the Listing itself.

Should I create 3 post types (1 for each package) or there's a better way to that?

I use Toolset and Elementor for styling, and WooCommerce for Subscriptions.

So in sum, I want to display different fields on the listing page, based on the subscription plan the client purchased.

Please let me know of the best way to achieve that.

Thanks

#2623219

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

You can display the different custom fields based on your subscription role.

You can use the conditional block and check the current user role and based on the subscription role you should display the different custom fields.
=> https://toolset.com/course-lesson/using-toolset-conditional-block/#conditions-based-on-user-roles

More info:
- https://toolset.com/2021/08/5-advanced-uses-of-toolsets-conditional-block-in-wordpress/

Can you please try that and see if that help you to resolve your issue.

#2623545

Thank you Minesh,

I'm still not sure how to assign a new user roles to a specific subscription package?

I was able to add conditional block and make a new user role with Access Control, but default Subscription role is Subscriber and I don't know where to add/assign additional role that I made (ie. Free Subscriber) and how to assign it to a specific package?

Also, can you please help me understand the toggle "not" in conditional block - it's very confusing ux. If the toggle is active, does that mean the element in condition block WILL be displayed, or not?

I appreciate your help!

#2623557

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I'm still not sure how to assign a new user roles to a specific subscription package?

I was able to add conditional block and make a new user role with Access Control, but default Subscription role is Subscriber and I don't know where to add/assign additional role that I made (ie. Free Subscriber) and how to assign it to a specific package?
==>
how exactly the user is going to buy your subscription?

Here is the doc that shows how exactly you should configure WooCommerce subscription plugin with Toolset:
- https://toolset.com/course-lesson/using-the-woocommerce-subscriptions-plugin-with-toolset/

Also, can you please help me understand the toggle "not" in conditional block - it's very confusing ux. If the toggle is active, does that mean the element in condition block WILL be displayed, or not?
==>
The "NOT" button is for applying the negation. so lets say if you want to check for NOT empty then you can add the condition for empty and then activate the NOT button so that means not empty.

#2623569
Screenshot at Jul 13 11-40-43.png
Screenshot at Jul 13 11-37-31.png

---- how exactly the user is going to buy your subscription?

So what I did is - I created 3 post forms, one for each subscription (free, standard, premium) and each of them has a different number of fields. I placed the forms in 3 different content templates that I later assigned to a specific package - that way each package the customer selects to purchase will redirect to filling the post form that is assign to it, and will display only those fields in the frontend - that was the best solution I could find for that purpose. I added an image of how I connected the post form - content template - package.

So after purchasing the package, based on the docs you sent and WooCommerce docs, all users will have the same, default user role (image attached).

This means having conditional blocks checking for a user role won't work, if all the user roles are "subscriber".

The particular problem I'm having right now is that I want to display a gallery for Standard and Premium packages, but for Free Listings it should be only a default background image instead of thee gallery. The second thing is a sidebar - Standard and Premium should have a contact form, and Free Listings only an ad.

Is there a way to achieve that?

#2623609

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

The Doc says:
=> https://toolset.com/course-lesson/using-the-woocommerce-subscriptions-plugin-with-toolset/

Subscriber Default Role

This is the role a user will be assigned after a successful purchase and the subscription’s activation.

Besides regular roles, you can also select any custom role you have created using the Toolset Access plugin.

That means you can create different role per your subscription and then what if you update it on fly. Will that work for you?

With the WooCommerce Doc:
- https://woocommerce.com/document/subscriptions/develop/action-reference/

I can see the following hook: woocommerce_subscriptions_updated_users_role


Description:
When a subscription is activated, suspended, cancelled or expired, the user’s role will also be changed, which triggers the 'woocommerce_subscriptions_updated_users_role' hook.

What if you try to use the above hook to assign your desired role when user create new subscription or check with WooCommerce Subscription support if they have any other hook to suggest that would work better in your case.

We can also use other WooCommrece order related hooks like woocommerce_thankyou or woocommerce_order_status_processing but its better to check with WooCommerce Subscription support so you will have exact idea what hook to use.