Navigation überspringen

[Gelöst] Loan Books System

This support ticket is created vor 4 years, 10 months. 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
- 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 -

Zeitzone des Unterstützers: Asia/Hong_Kong (GMT+08:00)

Dieses Thema enthält 5 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Luo Yang vor 4 years, 10 months.

Assistiert von: Luo Yang.

Author
Artikel
#2151203
sreen02.png
sreen01.png

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.

#2152375

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/

#2154899

Hi Luo. It seems to be a very good idea. Will try it on monday.
Thanks.

#2155037

Please update here if you need more assistance for it, thanks

#2156119

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.

Neue Threads, die von Luo Yang erstellt wurden und mit diesem verbunden sind, sind unten aufgeführt:

https://toolset.com/de/forums/topic/i-prefer-to-hardcode-the-theme-and-i-use-to-make-it-with-echo_shortcode-on-the-old-version-of-views/

#2156623

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/