Home › Forums › Toolset Professional Support › [Resolved] How to extend the forms woocomm plugin to prepay for single and packs of post
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.
Tagged: Content-submission forms, Toolset Forms
This topic contains 2 replies, has 2 voices.
Last updated by MargeP6083 2 months, 2 weeks ago.
Assigned support staff: Luo Yang.
Tell us what you are trying to do?
I want users to be able to pre-pay for post submission, then be able to post the number of posts they buy. For instance 1, 5, 10, 25 post packages.
Is there any documentation that you are following?
Is there a similar example that we can see?
I'm having trouble locating this example. It works like a job board, but to buy the job postings in advance.
What is the link to your site? hidden link
Do you have recommendations on instructions?
English (English )
Chinese (Simplified) (简体中文 )
There isn't such kind of built-in feature within Toolset Forms plugin, as you see in the document you mentioned above, it can charge the user once he create a new post.
In your case, it needs custom codes, for example:
1) Create a new numeric user field "post packages"
2) Setup some Woocommerce products for users to purchase:
- 1 post package
- 5 post packages
- 10 post packages
3) After user buy one of above product, for example "5 post packages", and complete the Woocommerce order, use Woocommerce built-in action hook "woocommerce_order_status_completed" to trigger a PHP function:
4) in this PHP function update user field "post packages" value + 5
5) Create a post view
- query posts
- filter by post's author same as current logged in user:
- in section "Loop Editor", you can get total post found count with shortcode [wpv-found-count]
get current user's "post packages" field value with Types shortcode [types usermeta='post-packages' format='FIELD_VALUE' current_user='true'][/types]
Use shortcode [wpv-conditional] to compare above two shortcodes, if "post packages" field value is higher, then display below creating post form
6) Create a post form for creating new post, after user submit the form and new post created
For your reference.
This is incredibly helpful! I had trouble thinking this through. Woocommerce has a trigger add-on that might work here. I will give this a go and contact a contractor if I can't complete this.
Very grateful for your help!
My issue is resolved now. Thank you!
Known issues and solutions
Frequently asked support questions
Support tickets archive
Get help from experienced contractors
Meet Toolset support team
Toolset Customer Support Policy
Need to tell us something about the quality of support
How to remove personal information from your database for support