Skip Navigation

[Resolved] User credit system for posting content and unlock features

This support ticket is created 5 years, 8 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
- 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)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by MennoB5853 5 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#1256671

I'm trying to build a job site with Toolset. It has some free features but also premium features like posting a job or unlock extra profile fields etc.

The job site is part of my network of companies where i have 1 main site where people can buy credits and can use them across the network. I already created a custom user field 'credits' and connected this to the api of the main site. Now i would like to use the 'credit' field for activities on the job site.

My idea is to use the form plugin of Toolset and after submit the credits field of the user lowers by x credits, where the number of credits is defined by the choices in the form. When the credits are zero the form can't be submitted.

Is there a way to do this?

Thanks, Menno

#1256863

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Well - As I understand, you will create a custom field "credit" on XYZ (your main site) site on network and you want to allow this "credit" to use on other network sites. To update the custom field on network sites is not tested or it needs custom programming.

There is no native solution I can offer here but I can only say that you need to check and play with it. Maybe you should try to create a test site using our test platform discover-wp.com and try to install the test site on your local platform using "Framework Installer" plugin and play with it.
=> https://toolset.com/documentation/user-guides/using-framework-installer-to-install-reference-sites/

Another thing I can think of is to use ifram to display the form to use credit but again the question will be how you can get the current login user ID (to identify the user) from whose account you will need to subtract the "credit".

I would say this eventually needs custom programming which is beyond the scope of our support policy.

#1256867

Hi Minesh, thanks for your response.

I would like to have user custom field 'Credits'. My setup is not a multisite. I have one main site build on Ruby on Rails with a JSON API. This is also the place where people buy the credits. I would like to build a single WordPress install with a JSON API to show the credits into the child site. The problem is not how to transfer the credits and other user data to the WordPress child site.

The problem is how to lower the user field 'Credits' when someone submits a job through the forms plugin for example. Maybe use a hidden field in the form where the user mail address and credits are shown?

Thanks

#1256959

Minesh
Supporter

Languages: English (English )

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

opps. Again, This will need custom programming which is beyond the scope of our support policy.

However - With Types 3.3 release, we added support for REST API.
=> https://toolset.com/documentation/programmer-reference/toolset-integration-with-the-rest-api/#how-the-integration-works

If you will check above Doc you will be able to know how to expose the Toolset custom fields and within what container you will find the custom fields.

The problem is how to lower the user field 'Credits' when someone submits a job through the forms plugin for example. Maybe use a hidden field in the form where the user mail address and credits are shown?
=> If you have forms, Form supports API hook cred_save_data that you may try to use to fire your REST API endpoint to lower down the "Credits" field.

More info:
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

How you need to create REST API endpoints and what logic you need to write thats on you.

#1256973

I really need to test this out :). Thanks for sharing the resources, great support!