Skip Navigation

[Resolved] Configuring a membership subscription for the creation of 1 listing in directory

This support ticket is created 3 years, 9 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 3 years, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#2343515

Tell us what you are trying to do? I am trying to set up a membership directory. I set up the Membership product as describe in the instructions (simple subscription, virtual, and sold individually). I want each membership subscription to automatically create only 1 Listing (custom posts created with toolset already). I want subscribing members to only be able to edit their 1 Listing, as each membership should only grant 1 associated Listing, not create a listing(s). I have the User Form to "Update Listing" to edit existing listing. How can I automatically add 1 new listing to each membership?

Is there any documentation that you are following? yes chapter 6

Is there a similar example that we can see? n/a

What is the link to your site? hidden link (helpmeplease)

#2343763

Hello,

I assume we are talking about below Course document:
https://toolset.com/course/wordpress-membership-sites/

There isn't such kind of built-in feature within Toolset plugins, and in your case, it needs custom codes.

For example:
1) create a custom user number field "Listing-count" for Members users
https://toolset.com/course-lesson/creating-custom-fields/

2) After user complete Woocommerce order, use action hook "woocommerce_order_status_completed" to trigger custom PHP function
hidden link

3) In this PHP function, update user field "Listing-count" value +1

4) In the user's listing page, use [wpv-conditional] shortcode to check the user field "Listing-count" value, compare with current user's listing post count, if it is great than post count, display the post form for creating "Listing" post.

More help:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-conditional

#2343937

If the Member Role can only edit not create a new listing, why would I need a customer user number field (example 1) or are steps 1-4 instructions on how to automatically create 1 listing per WooCommerce order?

On the "My Account Page," I was going to put a dynamic button that linked to "Edit Your Listing." Would that not work without the custom code?

#2344277

Unfortunately, there isn't such kind of built-in feature too, it needs custom codes, for example:
1) After user complete Woocommerce order, use action hook "woocommerce_order_status_completed" to trigger custom PHP function
hidden link

2) In this PHP function, create a new listing post dynamically:
https://developer.wordpress.org/reference/functions/wp_insert_post/