Skip Navigation

[Resolved] Credit System Based on Classifieds Reference Site

This thread is resolved. Here is a description of the problem and solution.

Problem:
1) I am thinking to re-elaborate the existing Classifieds Ad Package as user wallet since it already maintains a count of available credits. What is now "credits" in my case would be "dollars" (or any other currency). Would you say that this approach make sense?

2) Would you please suggest which php files in the Classifieds site relate to the Ad Package, so that I can start doing some code customizations?

3) I need to add a back-end function that based on some triggers (i.e. post expiration or user submitting a form), it either increases or reduces the amount of credits in one of the user's existing Ad Packages.

Solution:
1. Yes that would be good to go.

2. The best approach is to quickly create a Test reference site on http://discover-wp.com/site-types/classifieds-layouts/ and explore the page’s backend of how we have set things up OR you can import reference site for testing.

3. For this you would need to create custom function or shortcode or something that will modify credits. You will most likely be using CRED API and Views API to achieve this.

Relevant Documentation:
https://toolset.com/documentation/programmer-reference/

This support ticket is created 6 years, 9 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
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#549684

Hi,

I need to develop a User Wallet / Credit System. I am thinking to base my development on the Classifieds reference site, and would like to ask you advise on the followings:

1) I am thinking to re-elaborate the existing Classifieds Ad Package as user wallet since it already maintains a count of available credits. What is now "credits" in my case would be "dollars" (or any other currency). Would you say that this approach make sense?

2) Provided you agree with above point 1), would you please suggest which php files in the Classifieds site relate to the Ad Package, so that I can start doing some code customizations?

3) I need to add a back-end function that based on some triggers (i.e. post expiration or user submitting a form), it either increases or reduces the amount of credits in one of the user's existing Ad Packages.

#549696

I think I have found the answer to 2), the toolset-classifieds plugin, isn't it?

#549819

Noman
Supporter

Languages: English (English )

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

Hi Noriko,

Thank you for contacting Toolset support.

1. Yes that would be good to go.

2. For the Ad Packages (hidden link) there is no php files involved, all this is created using Toolset Views, CRED, CRED Commerce plugins. The best approach is to quickly create a Test reference site on http://discover-wp.com/site-types/classifieds-layouts/ and explore the page’s backend of how we have set things up OR you can import reference site for testing.

3. For this you would need to create custom function or shortcode or something that will modify credits. You will most likely be using CRED API and Views API to achieve this:
https://toolset.com/documentation/programmer-reference/

Thank you

#550096

Thank you so much. I will give it a go and get back. Would you mind to keep the thread open meantime for a couple of days in case I have some follow up questions?

Thanks a lot

#550117

Noman
Supporter

Languages: English (English )

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

okay sure, the ticket will stay as "Waiting" for 2+ weeks so you can take your time, have a great day. Thank you

#550186

Though, forgive me, Noman, but your answer to 2) is not quite correct. The Ad Package has a conspicuous amount of coding n the toolset-classifieds plugin.

For example, if I want to decrease the wpcf-user-total-available-ad-credits by an arbitrary amount rather than just 1, I need to work on package_order.class.php. Same goes when I need to increase the user credits not just by the default 5 but by some custom amount based on how much credits the user purchases.

I will start looking into that code and figure out how to customize it to my needs.

#550297

Noman
Supporter

Languages: English (English )

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

Oh that’s interesting, I apologize for the mistake, didn’t know about this exceptional case with our reference site. Thank you for pointing this out 🙂

#560977

At the end I went for that approach. Thanks.

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