Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Is this possible? write a rental module and link with availability / bookings calendar

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1625 Views
  • podge
    Avatar
    Community Member
    6 Posts

    Is this possible? write a rental module and link with availability / bookings calendar Link to this post

    Hi there,

    I recently installed silverstripe locally, and have to say it seems great so far.
    I'm thinking of using it for a client website. It has everything i need except one item: The client wants to set up a few pages of products available to rent, and would like to allow visitors to view availability of items by date, and then make a booking.

    Does the silverstripe structure / code allow for development of this type of module?
    Or should i be looking at getting a custom system developed?

    Any advice much appreciated
    tks

  • Double-A-Ron
    Avatar
    Community Member
    604 Posts

    Re: Is this possible? write a rental module and link with availability / bookings calendar Link to this post

    Hi Podge,

    This would be a custom jobbie for the most part on a few key points:

    1. A new page type for each rental item
    2. A new page type for holding and displaying a list view of rental items.
    This tutorial should help with these two: http://doc.silverstripe.com/doku.php?id=tutorial:5-dataobject-relationship-management

    I used the above tutorial to build a similar solution for a client who sells travel tour packages. Each tour had a (huge) group of custom fields. I also added a new class for Tour Dates, which is a one-many relationship (again, see that tutorial) so uses can see availability.

    The big difference is, my client didn't require a search by date, and the dates were set ranges (e.g. no availability checking is done) so:

    3. A custom method in your search page that returns an object based on criteria. This can be acheived by using DataObject::get(), the details of which can be found here: http://api.silverstripe.com/sapphire/core/DataObject.html#get. I havn't implemented something like this before, so I am unsure of how to actually implement it sorry. Someone else might have some ideas or a different method. Personally, I would make a custom search page just for this purpose, so your general search is still usable.

    4. Booking - again, I'm having to do a similar setup for my client, however they have only paid to have provisional booking details emailed to them and payments made manually. This suits them. What I did was on the Tour detail page (in your case the Rental Detail page) I have a big booking button that is simply a link with the id of the tour in the url. The subsquent page (a type I called TourBooking) uses that ID to pull out all the info for the tour using DataObject::get_by_id: http://api.silverstripe.com/sapphire/core/DataObject.html#get_by_id. I then use this to manually create a form with selectable elements pertaining to the Tour. (Like add-ons, date requested etc). This form then emails the booking details and saves a copy of it in plain text. Again, the client didn't pay for full integration of bookings to the CMS. You however, will need to do this, otherwise availabilty checking won't be possible.

    5. Calendar - if you mean in the traditional 28/31 day displayed calendar, this would be a large job. I don't know if a plugin of sorts is available as yet. A very cool plugin to build would be Google Calendar integration however.

    So yes, Silverstripe can do this, but be prepared for a learning curve and possible delays as the answers are not always apparent at first. My development has certainly had some hitches, but still a damn sight faster than trying to do the same from scratch, or Drupal (which is my old CMS of choice). I am still a week or so away from completion, but I'll be happy to share some of the code with you if it helps to get you understand the system faster. But the tutorial above formed the base of my entire customization.

    Cheers
    Aaron

  • Willr
    Avatar
    Forum Moderator
    5499 Posts

    Re: Is this possible? write a rental module and link with availability / bookings calendar Link to this post

    5. Calendar - if you mean in the traditional 28/31 day displayed calendar, this would be a large job. I don't know if a plugin of sorts is available as yet. A very cool plugin to build would be Google Calendar integration however.

    As part of the Events Module there has been a calendar module released. Check that out for some guide on that part - http://open.silverstripe.com/browser/modules/calendar . Its pretty bare bones at the moment, needs some development and testing to get it to production level I think but it should be a good start..

  • podge
    Avatar
    Community Member
    6 Posts

    Re: Is this possible? write a rental module and link with availability / bookings calendar Link to this post

    aaron, willr,

    thanks for the detailed notes / pointers. think i'll go ahead with the silverstripe setup, and add in the rental module as an upgrade once the site is up and running. I won't be doing the module work myself. I mostly do xhtml / css, so i'm no php wizz.

    Its great to know that the system is so versatile.

    cheers

    1625 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.