Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
Hi

I have a project due to start soon and I am thinking of putting a availability calendar in that will show available and unavailable days and be good if the user can book and pay for that day and see couchcms has the event calendar and couchcart

has it already been done where the calendar and cart can be merged to create a booking system and pay via PayPal or if not been done, can it be done?

Thank you in advance
ianhaney wrote: create a booking system and pay via PayPal

Hi, I saw some documentation for cms:calendar and now think that this can be done for example via following routine (with a LOT of work).

Resume: you gonna have problems anyway, as Couch can't send to paypal information that product is not available anymore ('booked'). I'm not sure if Paypal even accepts this kind of messages for on-going payments. So a user can pay anyway if he wishes so, even if someone 'occupied' that day 5 minutes ago. If you can solve this problem, then read on below:

Have a template with cloned pages, each page represents a 'booked' day. If several days in a row are 'booked' then it must be a separate cloned page for each of them. Empty 'available' days do not need a cloned page.

There is a tag 'cms:entries', which is a stripped down version of cms:pages, which will list through all pages for a certain date. If there are no pages for a certain date, then you can mark this day in calendar as 'available'.

If user clicks on a link in that day, you can present the user a form to fill and with data-bound-form create a new page with that date, user-inputted values and fixed chosen date. If user selects several days in a row then multiple pages must be created (try this first, as there might be some problems with creating several pages).

Now, with paypal it's gonna have this amendment. As we know, paypal payment can be delayed and processed ater or abandoned by user. So, when the page for a date is created it must have some status 'on-hold' or something, which will make it unavailable for booking for some time (amount of time you allow for reservation before purchase). Concurrent requests must be prevented so 2 users can't pay for the same date.

Some cron job must check if a page has NOT been 'purchased - paid for' within a reasonable time and 'release' the day, by deleting that page. But if user pays for it anyway - you gonna have problems as described in resume above.
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
2 posts Page 1 of 1