Hello,
I need to built a paid membership site and would like to know if I can do this with the Toolset.
What I need is to offer a yearly calendar membership (from Jan, 1st to Dec, 31st) and let people that have subscribed (paid) the ability to have access to specific part of the site (pages, posts ...). So, I need to define the start date and the end date of the subcription.
Thanks to tell me if this is possible and if I need other plugin than Toolset to perform this.
Pat
Hi Pat,
It is not possible within Toolset, and I am not sure it is possible with other plugins
You can try search in wordpress plugins:
http://wordpress.org/plugins/search.php?q=subscription
Or try the official Toolset Custom Development Services
hidden link
or our certified partners.
https://toolset.com/consultant/
Hello,
First of all, I'm surprised with this answer as I ask the same question in the "pre sales" contact form and everything was feasible!
I was thinking to create a product with the subscription price within Woocommerce, and then a form with CRED Commerce and assign the product to the form. What I need to know is how I can change the custom field linked to the "role" that have to be assigned to the member in the end of the order validation process.
Regards
Pat
Hello Luoy,
Just to give you additionnal info on this : the start date is not mandatory in this case. If I create a product, that would be for a specific year. The only point that bother me is what I was describing in my preview post (the way to change the "role level" of the member in the end of the order validation process) and the other point is that, if we cannot define an end date for the subscription, is it possible to create a form that would change the "role level" for all members (of a specific role) in the same time (meaning avoid the admin to have to go to each member and change the role level manually). I think this could be an acceptable solution for my client.
Regards
Pat
Pat, you can see our site https://toolset.com/
is using woocommerce + toolset + a custom subscription system(which created with custom php codes)
The subscription system we are using, also have same feature you mentioned above.
If you are not a PHP coder, as I suggest above, please
try the official Toolset Custom Development Services
hidden link
or our certified partners.
https://toolset.com/consultant/
Hello luoy,
Is there a list of the custom fields used by access in order to see if I can use them for this purpose within my form.
Thanks
Pat
Pat , what is the "my form" you mentioned above?
If it is a CRED form, Access can control it's user access,
More help:
https://toolset.com/documentation/user-guides/access-control-for-cred-forms/
Hello Luoy
In the meantime, I've found that all custom fields are listed in the database, so it's OK for me on this.
My remaining question concerns which custom field I have to use to change the role level for a user (ie : I want to move him from level 1 to level 2 for example).
If you have this info, that would be great to share it.
Many thanks.
Pat
The user role is stored in your database table "wp_usermeta", "meta_key" is wp_capabilities
Thanks luoy,
And how can I change this within a Cred form ?
Regards
Pat
Please try use CRED action hook:
cred_save_data
Hook to do custom action when post data are saved to database.
https://toolset.com/documentation/user-guides/cred-api/
Hi luoy,
Looking at the URL you gave me, I have a question : I understand I can modify any table field with the CRED hook. Now, what type of code do I have to use in the hook in order to change the value of a user meta data? The example in your URL shows something related to a specifiy type and not for a user.
Thanks
Pat
Pat, Please try use WP function update_user_meta() to change the value of a user meta data
http://codex.wordpress.org/Function_Reference/update_user_meta
Hello luoy,
As I need to make the action only after payment is received, I choose this code :
add_action('cred_commerce_after_payment_completed', 'affectation_membre',10,2);
function affectation_membre($post_id, $form_data)
{
if ($form_data['id']==279)
{
$current_user = wp_get_current_user();
$user_id = $current_user->ID;
wp_update_user ( array ( $user_id, 'role' => 'membre' ));
}
}
Unfortunately, this is not working and the role is not modified (I tried to finalised the order in my Woocommerce admin, but this does not change anything). Is there any mistake in my code ?
Thanks.
Pat
I suggest you try debug your codes line by line,
1)
...
echo $user_id = $current_user->ID; die();
...
Make sure it outputs the current ID
2) wp_update_user ( array ( $user_id, 'role' => 'membre' ));
it should be something like this:
update_user_meta( $user_id, 'wp_capabilities', 'membre' );
http://codex.wordpress.org/Function_Reference/update_user_meta