I'm trying to create form for a product (sponsorship article) with front-end submission with payment.
I've created the form (for creating a sponsorship post) and created a custom role (sponsor) through the access plugin. The reason is that I want to target different roles differently through clear segmentation.
Woocommerce has "customer" as role and Form has "default" or "author" as roles. Now, according to this scenario, I'm limited to choose the role of this product to either author or customer. So there is still a mismatch between the custom role (sponsor) I've created with access and the options presented by form commerce or woocommerce.
Unfortunately, when I reached: (Set the post author when payment completes)
Question:
It is not possible to choose from a dropdown or a list my created custom role (sponsor) for this specific "product" instead of this (After payment completes, make the client the author of the post)
If this is not possible at this moment, how can this be achieved programmatically? Do you have any idea how this can be achieved?
Would you consider this option to be implemented soon?
If your problem is that you have set up post forms to do the same and it is simply not working, then I can test that.
The title of your question is about setting the post author when payment status completes, have you tried that and it is not working?
You write about custom roles, but I'm missing the relevance of this in this particular scenario, if you could elaborate.
Btw, you will be pleased to learn that support for multiple roles is coming soon to Access. In the initial update there will be support for Access rules where users have multiple roles, to cover where other plugins (such as WC Subscriptions) add a role. A subsequent update will also let you set multiple roles within Access itself.
My question was simply to be able to set a different role than the one mentioned in the setting of the Edit Form (see screen)
"After payment completes, make the client the author of the post". I want the customer of this product assigned the "sponsor" role that I created with Access
Because, I created a custom role with Access (see screen). And I want after payment completes, make the client the "sponsor" of the post.
I hope it is now clear
Regarding you other questions, I spent a whole day testing but as you mentioned it's useless unless the notification issue with forms commerce is solved which I hope as soon as possible to be able to continue the implementation and test the whole purchase process, see the notification coming and see the whole process in action.
Now the status now is as follow
Edit form: puts the product in cart and redirects to a not found page. Then when I go to cart to proceed with order, I must be logged to check out
hidden link
User form: when I submit the form, it redirects back to the same form, although I set it up for purchasing a product.
hidden link
I followed the guides below for setting up the forms and woocommerce
Toolset Forms Commerce serves two purposes, but it sounds like you want a hybrid of the two.
You can use it to charge users to publish content (built on the back of post forms), or you can use it to charge users to register on the site (built on the back of user forms).
When you charge users to register, the form specifies the role they will be given when the process, including payment, completes. Custom roles are available (see screenshot).
But your screenshots and description are of a post form, used to charge users to publish content. There is no place for roles here. What changes as the order progresses through to payment is the status of the post being published. You can optionally specify who the author of the published post will be.
It sounds like you want to update the latter workflow so that not only is the post published when the order completes, but the role of the author of the post is changed to your custom role at the same time.
That's not something which is envisaged, and so would require custom code to set up.