Problem:
I have a client who is a locksmith. He has asked me to develop a site which will provide his customers with a private area on his site where they can view and purchase keys for their home. Each key will have a unique ID code, and when they log in to their private area they will be able to see the codes for any keys they own, and will then be able to purchase replacement keys through WooCommerce. On receiving an order he will cut and deliver the keys. The whole thing needs to be secure so no key codes are leaked.
Solution:
It is possible with Toolset + some custom codes.
For example:
1) Create a custom post type "Keys" + Custom single line field "unique ID code"
2) Create a form for creating the "Key" post, and charge the user after submit the form:
https://toolset.com/documentation/user-guides/using-cred-commerce-to-add-payments-to-forms/
3) After user submit the form, use action hook "cred_save_data" to trigger a custom PHP function
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
in this PHP function, setup custom codes:
generate a unique ID code, and update the custom field value "unique ID code"
4) Create a wordpress page "private area", in this page display a post view, list "Keys" posts, filter by post's author is current user, and display the "unique ID code" field
Relevant Documentation:
https://toolset.com/documentation/user-guides/filtering-views-query-by-author/
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/Hong_Kong (GMT+08:00)
This topic contains 3 replies, has 2 voices.
Last updated by 6 years, 3 months ago.
Assisted by: Luo Yang.