Skip Navigation

[Resolved] Users adding extra data to their profile to create a paid report

This support ticket is created 4 years, 10 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/Karachi (GMT+05:00)

Author
Posts
#1281321

Tell us what you are trying to do?
I need to create a kind of membership site were users register themselves and add custom data to create a paid report via a third party web app.

Is there any documentation that you are following?
I looked into https://toolset.com/documentation/user-guides/using-cred-commerce-to-add-payments-to-forms/ but step 4 would need to lead to a form after successful payment. How would I achieve that?
I also looked into the other form creation guides https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/.
And into the https://toolset.com/learn/create-membership-site-wordpress-using-toolset-plugins/#fees guide suggested before I bought the plugin as a potential pathway to implement the requirements.
But they do only partly help me with the requirements I have.
I have started to configure WooCommerce and create products, as well as Custom post types and custom fields for the membership forms. Yet how do I link them to a registered user?

Is there a similar example that we can see?
Sadly I have none.

What is the link to your site?
hidden link but there is not much yet as I need guidance in how to use Toolset to create a solution as per my requirements above.

#1281753

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi there,

Thank you for contacting us and I'd be happy to assist.

To link specific post(s) with a registered user, you can use WordPress own "Post Author" feature.
( ref: hidden link )

The detailed guide on the topic of linking content with users is available at:
https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/

Here is the brief summary of the workflow, that you're looking for:

1. Using WooCommerce and WooCommerce Subscriptions plugin (if you need recurring payments), you'll set up paid products, which will allow your visitors to register and get assigned a particular user role.
( ref: https://toolset.com/learn/create-membership-site-wordpress-using-toolset-plugins/ )

2. You can add a new custom post type named for example "User Reports" through Toolset Types and attach any custom fields to it, which you'd like the users to fill in after registration.

3. After a user has registered and logged in, you can present to them a new post form, to add a new report, which will be saved as a post entry in the "User Reports" post type.
( ref: https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/ )

Note: when a visitor will add a report as a logged-in user, he/she will automatically be assigned as the "Author" of that "User Report" post, which will act as the link between the user and a report.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1282313

Hello Waqar,

Thanks for the reply and guides and read through them to understand your approach.

1) So I would set-up membership with unlimited subscription to pay for one report and or just to limit the access to forms to registered users.

2) Then I would create these user report forms using Toolset Types and they will automatically be linked to the author, the user who created them.

3) But I would need the member to pay for each report he/she is creating as they will be able to change and or add data to get different report results.

This leads me back to my question:
When I looked into https://toolset.com/documentation/user-guides/using-cred-commerce-to-add-payments-to-forms/ but step 4 would need to lead back to their report form after successful payment. To make changes to and send/save the details again for creating a new report. How would I achieve that?

In essence I need something that allows to capture customer information via a form which is charged via a WooCommerce product. And that is only send or saved after the client has paid.
Or in other words I would allow them to make changes to their details and allow sending these only if they did pay for it before. Kind of a conditional send button that would go through the WooCommerce check-out.
I hope that makes sense.

Kind Regards

Dieter

#1283265

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Dieter,

Thanks for writing back and I apologize for the delay.

If your plan is to charge users for each report, this is much simpler to achieve using "Toolset Forms Commerce" plugin:

1. You'll create a new product in WooCommerce, let's say "Add a new report" and set its price as a regular product.

2. Next, you'll create a Toolset form to add a new "User Reports" post and set it to accept payment for this new product, from step 1.
( screenshot: hidden link )

3. In that form's settings, you'll also set it to take the user to the checkout page after the form is submitted and the newly entered "User Reports" post should initially have the "Pending review" status.
( screenshot: hidden link )

4. On the same form's editing screen, you'll also find the settings to set the status of this newly entered post during and after the processing of that order's payment.
( screenshot: hidden link )

Please also note the option to set the user who submitted the form as the author of this new post, when the payment has completed.

As a result, a user on your website will submit this form to add a new user report and will be taken to the checkout page, with the right product automatically included in the cart.

At this point, that user report will not be in the published state and will only be published, when he/she will complete the payment of this new order. Likewise, he/she can add as many user report entries as needed, after paying for them.

I hope this makes it clearer and let me know in case you have any follow-up questions.

regards,
Waqar

#1284439
Post Field Group-Member Reports.png
Product-Astro Family Report.png
Post Form-Create new report.png

Hello Waqar,

I have followed your steps and created the Product and the Post Form, including the related Custom Post type and Custom Field Group forms to be able to edit the information from the front end.

One issue I found is it would not proceed to the checkout for payment after sending it off. It did create the report post in the state of Pending Review and changing that to Publish did not create an order in WooCommerce!?

Another issue came up as I created and tried to integrate required Repeatable Fields Group content with the Custom Field Group to allow clients to add additional content as well.
But as I found out there is a limitation with front-end forms so only views could be used (https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/front-end-forms-for-repeatable-field-groups/#forms-for-editing-values-of-existing-repeatable-field-groups).
But adding the Repeatable Fields Group as a view is in essence just another editable form without the ability to add or delete new content rows in the front-end form!?
Do I need to add other controls to be able to add more than one data set in the Repeatable Fields Group via views?

Do I create a sign-up form with all the account forms first? Then add the report checkout form available for registered users only that need to be paid for before they can be processed? Or do I allow back-end access to the Custom Post type Reports for them to add/edit their reports including the Repeatable Fields Group?
And all needs to be tied together to the author/member of the report.

Sorry not sure what can and needs to be done, as this all is a bit mind boggling.

Kind Regards

Dieter

#1284901

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Dieter,

Thanks for writing back.

1. To troubleshoot why the form is not redirecting to the checkout page, after submission, I'll need access to the website's admin area.

Can you please share temporary admin login details, along with the link to a page where this form can be seen?

Note: Your next reply will be private.

2. Your understanding related to the repeating field group entries is correct. Toolset saves the entries in repeating field groups as a part of a hidden custom post type (family-member) and not as a part of the parent post type (Report Members).

This means that to add or edit a family member entry, you'll need to create a new form and the form that adds or edits a "Report Member" can't be used for both post types.

As for the last part of your message, here is how you can present your forms to your visitors:

a). To register as a user, a visitor will first fill a form to become a user.

b). After registration and logging-in, he or she will see a form to add a new report in the user area, which will collect all the information, except the details about the family members.

c). After the form's submission, that user will be taken to the checkout page, to complete the checkout process. Once the payment completes, that report's status will be set to published.

d). The user will see the newly added report in the member's area and clicking it will lead to that report's single detail page.

e). On the report's single detail page, you can show the form to add a new family member, along with the view that shows the list of already added family members (if any) and also the link to edit them.

Note: Allowing back-end admin access to visitors won't work in your case, since so you need to collect the payment for each report, which won't be possible, out-of-the-box, from the admin area.

regards,
Waqar

#1285779

Hello Waqar,

I retried to create and purchase a report via the cred-commerce form but would just be redirected to the homepage. A report post would also be created but nothing else happens, i.e. checkout process or order creation!?

Also if we wanted to get payment for extra reports, i.e. time limited subscription or for each new submission at reduced price, building on existing member report data. How best would we go about that!?

And I created the Membership sign-up and editing forms. And then went through the report creation process as mentioned before.
For the account interactions I created all the other forms, i.e. login, my account, logout, lost password and reset password form on their own pages as per this guide: https://toolset.com/documentation/user-guides/building-the-my-account-page/.
But ran into an error message with the lost password form page (URL/login/lost-password/). It states this error message: Warning: include(): Filename cannot be empty in /xxx/wp-content/plugins/woocommerce/includes/wc-template-functions.php on line 49.
By the looks of it it collides with the WooCommerce customer management functionality somehow!?

Is there a tutorial for step 2 d and e?

Kind Regards

Dieter

#1286233

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Dieter,

Thank you for sharing these details.

1. I noticed that the required WooCommerce pages like checkout, cart, shop, etc are not set on your website.
( screenshot: hidden link )

Please set them first and then check the form's redirection after the submission again.
( ref: https://docs.woocommerce.com/document/woocommerce-pages/ )

2. For time-based subscriptions and payment module, you'll need to include a subscription plugin like "WooCommerce Subscriptions", similar to what is explained in the guide at:
https://toolset.com/learn/create-membership-site-wordpress-using-toolset-plugins/

In that setup, you'll be collecting payments periodically to retain a certain user group access, instead of collecting the payment for an individual report, at the time of its submission.

This means that the first step is to lay out the plan of exactly what payment module is required for this project and then implement it accordingly.

3. The message "Warning: include(): Filename cannot be empty" would be related to the undefine WooCommerce Pages, as mentioned in point 1.

In case, the issue still persists, you can follow these steps:

a). Temporarily disable all plugins other than WooCommerce and see if the issue is fixed.

b). If it is fixed, you can start activating the disabled plugins, one-by-one, to narrow this down to a possible conflicting one.

c). If the issue persists, with only WooCommerce plugin, it would be best to report this to their official support team.

4. > Is there a tutorial for step 2 d and e?

> d). The user will see the newly added report in the member's area and clicking it will lead to that report's single detail page.

- For this all you'll have to do is to create a new post View, that shows only those user reports, which belong to the currently logged in user.

https://toolset.com/documentation/getting-started-with-toolset/create-and-display-custom-lists-of-content/
https://toolset.com/documentation/user-guides/filtering-views-query-by-author/

> e). On the report's single detail page, you can show the form to add a new family member, along with the view that shows the list of already added family members (if any) and also the link to edit them.

- This is the example of your single detail page for a report:
hidden link

I noticed that you're using Oxygen builder on your website. You can follow this guide on how to design and set a template for the post types:

https://toolset.com/documentation/user-guides/using-toolset-with-oxygen-page-builder/create-templates-for-custom-post-types-with-oxygen-and-toolset/

Here is a guide on adding form in content:
https://toolset.com/documentation/user-guides/learn-what-you-can-do-with-cred/

Important note: Since we've been discussing a lot of different topics in this single thread, this can result in a lot of clutter and confusion for you or anyone else looking for assistance around these questions.

This is why it is recommended to start a new ticket for each new question or concern.

regards,
Waqar

#1288447

Hello Waqar,

Thanks for the explanations.

As a first time user I am still getting my head around on how and what can be done with Toolset in combination with WooCommerce. Especially in regards our requirements which means we do need to allow for a purchase of the main report including details for 0 or many family members. And in the process make new users become members.
Then as a member purchases can be made for each follow-up report ordered separately.

1) and 3) The error "Warning: include(): Filename cannot be empty in /xxx/wp-content/plugins/woocommerce/includes/wc-template-functions.php" was resolved after creating the missing WooCommerce pages. So the payment process went through successfully.

2) Recurring payments, via subscriptions, could be another way.

4 d) I did follow your guidance to create views and still working on integrating the links to the form editor, etc.

You also refer to the members area!? There are now two My Account pages one created via WooCommerce and the other manually for the membership user forms (https://toolset.com/documentation/user-guides/building-the-my-account-page/). How to best use them together or combine them making the other obsolete, i.e. using and tweaking WooCommerce!?

Kind Regards

Dieter

#1289315
Toolset-repeatable-groups-view-issue.png

Hello Waqar,

Also I am struggling with the view creation process for repeatable group fields in posts even when following these tutorials and researched related forum posts for a solution:
https://toolset.com/2018/07/how-to-add-repeatable-field-groups-to-your-custom-post-types/
https://toolset.com/documentation/user-guides/filtering-views-query-by-author/
https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/
https://toolset.com/forums/topic/need-to-display-repeatable-fields-from-a-related-post-type/

Yet I do not seem to get it right as I do not seem get the post relationship choice. I tried various combinations within the view including main custom post type.

Kind Regards

Dieter

New threads created by Waqar and linked to this one are listed below:

https://toolset.com/forums/topic/split-view-creation-with-repeatable-group-fields/

#1289365

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Dieter,

Thanks for the update and glad that you're making progress.

> 4 d) I did follow your guidance to create views and still working on
> integrating the links to the form editor, etc.

- Great! please keep on creating views and forms and in case you face any difficulty, you can start a new ticket for each issue, explaining what you expected and what is happening instead.

As for your most recent message related to views creation with repeatable group fields, I've split it into a new ticket and will reply separately.
( https://toolset.com/forums/topic/split-view-creation-with-repeatable-group-fields/ )

> You also refer to the members area!? There are now two My Account
> pages one created via WooCommerce and the other manually for the
> membership user forms (https://toolset.com/documentation/user-guides/building-the-my-account-page/).
> How to best use them together or combine them making the other obsolete, i.e. using and tweaking WooCommerce!?

- You don't necessarily have to use two separate pages for "My Account" or "Dashboard" page.
( this is the page that members will see when they'll log in to the website )

Your website is already set to use the "My Account" page ( hidden link ) for this in WooCommerce settings.

The instructions to create a new account page from the guide ( ref: https://toolset.com/documentation/user-guides/building-the-my-account-page/#building-the-my-account-page ), would apply only when a page for this doesn't exist.

You can copy/merge the contents of the other "My Account" page ( hidden link ) into the first one and then delete it.

Note: in case your concerns related to what we've already discussed in this thread are resolved, please mark this ticket as resolved. You're welcome to start a new ticket for each new question or concern, which will make it more efficient and easy to follow for everyone.

regards,
Waqar

#1290813

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.