Skip Navigation

[Closed] We'd like the product to just register the customer with the Membership role we set up automatically

This support ticket is created 3 years 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 7 replies, has 2 voices.

Last updated by Luo Yang 3 years ago.

Assisted by: Luo Yang.

Author
Posts
#2253867

Thank you. This is great that this is doable with Toolset. I followed all the instructions on the page you provided. I was able to get through everything seemingly successfully. However when I go to the product page, something isn't working correctly. Go here for the example I've tried:

hidden link

Scroll down and you'll see the form created and present. I didn't modify the default fields for the form because I just want to see how it works first. The form looks like all is fine. However, if you look below the form, you'll see our product Attribute (State Forest Selection), the Quantity field and the Add to Cart button are now covered by a spinner and inaccessible. I can submit the form and it goes to the checkout page as we set it up, but we don't get the product Attribute selection this way. I suppose I could add the product Attribute as a field on the form instead if necessary.

But in reality, we don't really want to have a form set up. We'd like the product to just register the customer with the Membership role we set up automatically. Their user account should be set up with the normal Woocommerce product purchase. So what I'd ideally ask here is if we can just eliminate the form fields and have the Add to Cart button and product attribute display as usual and have the user that gets created from the product purchase have the custom Member role assigned? It's possible that we'd need to use a different plugin to achieve this result and not use Toolset for this.

I understand if your system requires the form to be submitted for the Custom Role to be assigned to the user account that gets created. If we must have the form present for this to work, then I'd like to ask your input on what to do about the Attribute, Quantity and Add to Cart button. We don't want to have that there showing with a spinner over it and inaccessible because that is very confusing. We definitely want that Attribute present in some way. We'd also like to keep the Quantity field present in case someone wants to purchase multiple memberships (maybe one for themselves and others for friends/family).

In the case that we must use the form for this to work, I'd also like to ask how this works for people that renew their memberships each year. We don't want them to have to create a new user account each time they renew, especially considering the user registration system requires a unique e-mail address each time. We'd like subsequent purchases to apply to their already existing account.

Any assistance you can provide here will be greatly appreciated. We're closer to what we want here and I'm hopeful we can get all the way there.

#2253925

Hello,

I assume the URL you mentioned above
hidden link

It is a single product post, you can follow our document to customize the single product post:
https://toolset.com/lesson-placement/lesson-placements-1666453-1666547/

And about the spinner issue, it is abnormal, please check below in your website:
1) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/

2) In case it is a compatibility problem, please deactivate all other plugins, and switch to WordPress default theme 2021, deactivate all custom PHP/JS code snippets, and test again

3) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

#2254399

It appears that the Woocommerce Name Your Price plugin is causing a conflict that is causing the spinner issue. I'm seeing the following in the console when the spinner issue is happening:

Uncaught TypeError: Cannot read properties of undefined (reading '$error')
at HTMLFormElement.onFoundVariation (name-your-price.min.js?ver=3.3.4:3)
at HTMLFormElement.dispatch (jquery.min.js:2)
at HTMLFormElement.v.handle (jquery.min.js:2)
at Object.trigger (jquery.min.js:2)
at HTMLFormElement.<anonymous> (jquery.min.js:2)
at Function.each (jquery.min.js:2)
at s.fn.init.each (jquery.min.js:2)
at s.fn.init.trigger (jquery.min.js:2)
at Object.success (add-to-cart-variation.min.js:1)
at c (jquery.min.js:2)
?v=2.0:16 WebSocket connection to 'hidden link' failed:
w @ ?v=2.0:16
?v=2.0:16 WebSocket connection to 'hidden link' failed:

I then deactivated the Name Your Price plugin and the spinner issue stopped.

The problem is we really need the Name Your Price plugin as that allows people to choose the amount they want to donate on our donation products. It is not active on the product we're testing your form on, but I guess the mere presence of it being active on the site is interfering with the functionality of Toolset here. I don't know if this is something where Toolset is causing the problem or something where Name Your Price is causing the problem in how they are not working together. I could try to get support from Name Your Price, but I'd guess they will tell me to contact you. And then you might say to contact them. So I'm not sure how to best handle that.

But I'm not sure if this is worth solving for this. Even if the spinner issue wasn't happening, I'm still thinking the way this works with the form being attached to the product isn't ideal because it's confusing to have the form's submit button there and then the Add to Cart button below it. Plus I think it's better for the attribute to remain an attribute of the product rather than moving it to be a field on the form. And we do want people to be able to order more than 1 membership in the Quantity field if they want to do so. Going through your form instead of through the Add to Cart button won't allow that unless I'm missing something.

I've found a 3rd party plugin called YITH AUTOMATIC ROLE CHANGER FOR WOOCOMMERCE for $69.99 that may be the better option for our needs on this topic. I've asked our project manager if she deems having the ability to assign custom roles on product purchases to be worth another $69.99 per year.

It's OK if Toolset can't do this ideally. This is functionality I never expected out of Toolset. I'm impressed that you have something like this to get it as close as it is. If you'd be willing to work out our issues with the way this works as something to improve on what you have for both us and future customers, I'd be totally happy to work with you on it. But understood if you'd rather not.

#2254545

Since it is a compatibility issue with plugin "Name Your Price", if you still need assistance for it, please provide a full copy of your website in below private message box, you can put the package files in your own google drive disk, share the link only, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#2254549

Before I send a copy of the site, let me know if you'd be OK with working with me on making this work more ideally in how things display after the spinner issue is resolved. There's no point in wasting your time doing so much work on solving the spinner issue if it's still going to be something where we're not liking how the product order process displays/works.

We'd want to incorporate the Toolset form in a way that keeps the Quantity field and the Product Attribute as part of the process. Ideally, the way to do this would be to eliminate the form Submit button and have it's functionality be achieved with the Add To Cart button. If the Add To Cart button would simultaneously handle the normal ordering process and the submission of your form data, that would be PERFECT. It's too confusing for end users to have both the submit button and the Add to Cart button simultaneously present. And if the role assignment we're trying to achieve only works through the submit button that would be problematic as well if people only hit the Add to Cart button.

But I realize that may involve some very complicated programming on your end to achieve this and it may be asking for too much from free support. But I do think most anyone using this feature would like that display and functionality much better, so this wouldn't be work done solely for us here. This would be of benefit to any of your customers that use this feature IMO.

Let me know your thoughts there. If you're OK with doing it, then I'll get you the site as needed so you can work on it on your localhost to figure out the conflict with Name Your Price. Sorry this issue is proving to be this difficult. Thanks for all the help.

#2254681

There might be some misunderstandings, Toolset Forms plugin is for managing custom posts/pages, it won't manage Woocommerce order posts, if you insist on using Woocommerce "add to cart button"-> Cart-> Checkout process to change the user role, you can consider other plugins or custom codes, and in my opinion, you can try "WooCommerce Subscriptions plugin", see our document:
https://toolset.com/course-lesson/using-the-woocommerce-subscriptions-plugin-with-toolset/

#2254701

I looked at Woocommerce Subscriptions and it won't work because it only allows one user role as detailed here on your page:

----------------------
Can I create two (or more) subscriptions with a different role for each subscription?
No, you cannot. The role you set up in WooCommerce Subscription (see step 3, Subscriber Default Role) is a global one and applies to all your subscription products.
----------------------

We have several membership levels that each get their own role on membership purchase. That's why I looked at

YITH AUTOMATIC ROLE CHANGER FOR WOOCOMMERCE

That one seems to handle what we want. So I think we'll try that. In one of the other support threads we now have a field that successfully pulls the User Role. So it should work no matter what role is present for the customer in the order reports. That's all we'd need Toolset to be able to do, so we should be OK here. I just have to confirm with our project manager that she is OK with another $69.99 per year for the Yith premium plugin for this functionality. It's not certain that we NEED this going forward. It's just nice to have. It didn't cost extra to set it up on the Drupal version of our site, but we may decide to just not do it in WordPress. Please keep this ticket open until I get an answer from our project manager on this. But it's probable that we're OK here.

#2255133

I have marked this thread as "Waiting for feedback" status, please update here if you still need assistance for it.

The topic ‘[Closed] We'd like the product to just register the customer with the Membership role we set up automatically’ is closed to new replies.