Skip Navigation

[Resolved] How can I include a country selection field for user registration?

This support ticket is created 7 years, 1 month 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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)

Author
Posts
#581532

Thanks Minesh for the code, I'll test it to see if it works correctly. 🙂

#581534

Minesh
Supporter

Languages: English (English )

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

Your welcome 🙂 - if all sorted you may close now and feel free to open a new ticket when ever needed 🙂

#581541

Well, even if the code works, it does not mean that this functionality should be in the Toolset kernel. It is basic and necessary. So I should not close the ticket until it has been resolved correctly. ????
In fact, your tutorial to make a site memberships can lead to incurring users to commit illegalities. 🙁

#581547

Minesh
Supporter

Languages: English (English )

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

Well - we all know that the functionality you want is neither available within Tooslet Kernal as its not implemented and unfortunately, that's the fact.

We already followed the process to file your feature request and we already confirm that this will not be implemented soon, as this info will help you to move forward with your project and you can take decision accordingly.

FYI - if you will not close this ticket, it will automatically closed after 30 days.

If you have any other queries, Please feel free to open a new ticket and we are happy to help you with any issue related to Toolset 🙂

Have a great day 🙂

#581610

Is there anything I have to do so that the code you have given me is executed?
I have put the following code in functions.php

add_action( 'cred_commerce_after_order_completed', 'my_woocommerce_order_completed', 10, 1 );
function my_woocommerce_order_completed( $data ) {
//  if ($data['extra_data']['cred_product_id'] == 35283) {  
	$user = new WP_User( $data['user_id'] );
       $user->add_role( 'ClienteVIP1' );
//  }
}

and the user does not take the role that I am indicating.
What can be happening?

Thanks for your help.

#581618

Minesh
Supporter

Languages: English (English )

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

Well - did you check is new user created in your system? If yes - I need to follow the whole checkout process and check why role is not changes for that I need temporary access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#581643

Minesh
Supporter

Languages: English (English )

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

Sorry - where I can see the transfer option and where did you insert CRED form?

Please make sure that you have followed the instructions with the following Doc:
=> https://toolset.com/documentation/user-guides/charging-payments-with-cred-to-register-users/

Without CRED form + CRED Commerce settings in picture - how can it will fire CRED commerce hook I shared with you?

First of all - please understand the Workflow and follow the exact steps mentioned with the following Doc and follow the steps accordingly and try to purchase product as per steps mentioned:
=> https://toolset.com/documentation/user-guides/charging-payments-with-cred-to-register-users/

#581647

Miresh, I do not insert any CRED Form.
If I use a CRED Form for registration then I would have the problem we talked about. 🙁
In order not to have the problem of European legislation the registration of the user must do the own form of WooCommerce, not CRED.
When you make the purchase you can simulate the purchase with the transfer option so you do not have to use a credit card.
What can I do to avoid using the CRED form?

#581652

Minesh
Supporter

Languages: English (English )

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

Well - then find WC hook to update the user role.

You can use WC standard hook: woocommerce_order_status_completed

More info:
=> hidden link

#581654

All right. I'm going to do more tests. Thanks for your help.

#581658

Minesh
Supporter

Languages: English (English )

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

Your welcome!! 🙂

I found one more link that may help you - you can use at your convenience:
=> https://stackoverflow.com/questions/19681523/woocommerce-changing-user-role-when-order-is-complete?answertab=votes#tab-top
=> https://wordpress.stackexchange.com/questions/120656/woocommerce-change-user-role-after-completing-order

Now, I think I've answered all your questions and if everything is resolved - you can resolve this ticket before it become 10 pages story 🙂

#582029

Minesh,

I'm sorry, but we have to keep up with the problems.
I have installed a plugin to manage the roles that connect when a purchase is made from WooCommerce (YITH Automatic Role Changer for WooCommerce). The plugin works perfectly, when the purchase is made the plugin automatically assigns one or more roles to the user who made the purchase. However, the page that is protected by 'Toolset Access' still can not be seen.
hidden link
The data that I tell you to log in to my site are still active, so you can see the problem directly on the site.

Thanks for your help.

Best regards,
Francisco R.

#582284

Minesh. Do not you answer me?

#582306

Minesh
Supporter

Languages: English (English )

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

Ok - I would like to know which user you created and as I understand with the new plugin you installed (YITH Automatic Role Changer for WooCommerce) - as you said its working fine.

Now, I see that with access you created "post group" VIP Pages and VIP pages group is assigned to role "ClientVIP1" - is this correctly setup and is it setup as your requirement? If yes:

Could you please share whole workflow - how it should work and what pages restricted and when we allow them access and which roles can access such pages.

#582315
sc001.jpg
sc002.jpg
sc003.jpg
sc004.jpg
sc005.jpg

The page protected by 'Toolset Access' is:
hidden link
In the attached screenshots you can see all the sections of the dashboard related to the problem.
As you will see, the user 'jamolina2010' has the roles 'Client' and 'ClientVIP1', so that user should be able to see the page:
hidden link

Thanks for your help.