Hi everyone!
I have a CPT called Library where I have a good amount of books published and I need to turn it on a loan books system. I already have my archive library page working, with all the books paginated. Now I have to create a system where logged in users can use a checkbox or a select to choose a maximum of two books. The information of the selected books must be sent by email to the website administrator. I am using Contact Form7 but I cannot find any documentation about how to do it with Toolset.
Any help will be fully appreciated, thanks.
Hello,
You can try these:
1) Create two post types:
- Books
- Loans
Setup one-to-many relationship between Books and Loans
2) Create a post form for creating new Loans post, setup the email notifications settings:
https://toolset.com/course-lesson/send-notifications-when-someone-submits-the-form/
3) In the single Booke post, display a post view:
- Query Loans posts
- Filter by post author is same as current logged-in user:
https://toolset.com/documentation/user-guides/views/filtering-views-query-by-author/
- In section "Loop Editor", you can get the post found count with shortcode [wpv-found-count], use it in [wpv-conditional] shortcode, if the result less than 2, then display the post form link of step 2), for example:
[wpv-conditional if="( '[wpv-found-count]' lt 2 )"]
Here display the child "Loans" forms shortcode
[/wpv-conditional]
More help:
https://toolset.com/course-lesson/selecting-parent-posts-when-using-forms-to-create-child-items/
Hi Luo. It seems to be a very good idea. Will try it on monday.
Thanks.
Please update here if you need more assistance for it, thanks
Hi Luo.
Ok, I have all done, the post forms and the two CPT, however I didn't know hoy to implement the post view on the single book post page. I prefer to hardcode the theme and I use to make it with echo_shortcode on the old version of Views, but with the new Blocks I can't see any shortcode. I could be a very dummy question but I do not the new version very much. Sorry.
Another issue I have is the book checkbox and how the post form will get that information.
Thanks.
I assume the original questions is resolved, according to our support policy, we prefer one ticket one question, for the other new questions, please check the new thread here:
https://toolset.com/forums/topic/i-prefer-to-hardcode-the-theme-and-i-use-to-make-it-with-echo_shortcode-on-the-old-version-of-views/