Skip Navigation

[Resolved] We need to integrate our CPT with a third party rental plugin

This support ticket is created 5 years, 12 months ago. 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 8 replies, has 2 voices.

Last updated by kristofG 5 years, 11 months ago.

Assisted by: Nigel.

Author
Posts
#1154505

We are rebuilding a website for a real estate agency that rents holiday homes in Portugal. The first site we have built just used a dedicated real estate theme but that could not be tweaked enough so now we are rebuilding the site with the Toolset plugins. Building the CPT will be no problem, but this time we need to integrate this into an availability plugin like here: hidden link

Most booking plugins have their own CPT but don't allow adding extra fields via Types or we can't use Views to build our own pages.

Is there a booking plugin you are aware of that integrates beautifully, meaning, we create our own CPT that then can be linked to the availability/booking plugin?

#1154779

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Kristof

Sorry for the late reply, the forums have been busy today.

I'm not aware of any such plugin off the top of my head, but I could have a look given the criteria you mention.

But to save me some effort, are there popular plugins you have looked at that you know are not suitable?

#1155264

hi Nigel,
no worries!

I am currently looking at HBook which seems to offer a lot of features. There is a text editor where you can insert a property descriptions and there are even some shortcodes you can use, but we would need to add at least 20-30, if not more, custom fields to a property.
The question is now, should/can we add all our required custom fields to their 'accommodadtion' field or should we keep the Toolset CPT separate?

I noticed in their plugin, we can choose a custom page to display a property, so we would still be able to use Views or Layouts for the front end view of a property. Question on the side, I am still struggling when to use Views or Layouts to build a page. As always, we will be using the Avada Theme.

#1155399

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Kristof

I looked at the HBook plugin documentation. It is difficult to tell what you can and cannot do without installing it and testing.

I searched their documentation for "custom fields" and got not results, but from the screenshots it looks like Accommodation is a public post type, and so it should be possible to add custom fields to it.

The unknown is whether it is possible to create a template for accommodation posts which overrules their own templates so that you can output your custom fields, and without the plugin to test we cannot know. I imagine you will need to persist with their accommodation post type for much of the functionality to work.

Regarding the general question about creating templates with Views or Layouts, my personal rule of thumb is to use Views Content Templates by default and only use Layouts if I need more control over what goes where on the page. Anything you did in Layouts you would be able to do with a Views Content Template (after all, we are talking about outputting HTML), but for Layouts provides the GUI for setting up content in a grid and a Views template would require more manual intervention to achieve the same.

However, if you are using Avada then the decision is effectively made for you. You should use more than one page builder, so if you are using Avada you will want to disable Layouts and design Views templates either manually (for simple templates, especially if you are just inserting a shortcode for something like a View) or with Avada.

If you get a copy of HBook and need help testing, let me know.

#1155418

Hi Nigel,

I've just received a response from HotelWP/HBook as I have asked them the same 2 questions: 1/ custom pages to display properties and 2/ where to add the custom fields.

Their reply:

For the first part, i.e. creating your front end pages to display the properties, this is perfectly fine. As explained, you will use HBook accommodation types only to fill the settings (occupancy settings, number of accommodation of this type, etc...) and the description that will be displayed in the search results (and accommodatin list if you wish to use HBook [hb_accommodation_list] shortcode). ou will use the "Accommodation display" settings to link HBook accommodation type to the matching page used for front-end display purposes. By doing so, when a visitor clicks on "View accommodation", it will be shown your front-end page. And you will be able to use the HBook shortcodes on your pages used for front-end display to include a rate table, availability calendar or booking form (without needing to use the "accom_id" parameter). To read more about shortcodes: hidden link ortcodes

As for the second part of your reply, to add custom fields to the property: we haven't tested with Toolset yet so I can not guarantee that you would be able to add these custom fields to the "hb_accommodation" custom post using Toolset. I have had feedback from one client who used Toolset and he had issues when adding translation pages of his HBook accommodation posts. However, he wasn't using theme pages to showcase his accommodation. The issue is simple to understand: HBook shows only the fields "Description displayed in the search results" and "Description displayed in the accommodation list" in the translated pages. Let's say your main language is "English" and you have a multi-language plugin to translate to "French" and "German". The "French" and "German" versions of the accommodation posts did not show the Toolset custom fields. Hoping it makes sense!

So I guess it would be best to add these custom fields to your pages used for front-end, unless Toolset gives you a different feedback. 😉

#1155497

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Well, that sounds promising, but—again—without trying it I can't say for sure.

It seems like the intention is for you to create a static page to display the accommodation posts, it doesn't seem to provide for displaying a single accommodation post as one normally would, but it might work. If not you can design the static page as they describe, but when you insert the shortcodes to output your custom fields it would need to know what accommodation post should be used as source.

Maybe the ID of the accommodation is passed as a URL parameter, in which case you could use the same parameter.

It sounds like it ought to be possible, but I can't say for sure without seeing it.

#1157857

Hi Nigel,

We would need to create 3 "types" of pages.
1/ a type of homepage where we can put a filtered view of different accommodations (example: hidden link)
2/ a category page again with a filtered view of different accommodations, most probably filtered by taxonomy or tag. (example: hidden link - taxonomies holiday home & near the beach)
3/ an accommodation detail page with slider, custom fields and an availability/booking frame.

Now, for the first 2 types, we don't really need the HBook plugin, this can be done completely with the different Toolset plugins. But for the 3rd type, we are still wondering whether to create our own CPT and try to integrate the availability and booking part provided by the HBook shortcodes or use their accommodations post type and extend that with the Toolset custom fields. I know that we can user our own pages (hidden link) although, even after reading that article, I don't understand how we can link the Toolset custom fields to the HBook accommodation.

The people at HotelWP have granted me a 28 day refund. That way, I can provide you with the plugin.

#1157977

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I would certainly start from the direction of using their accommodation post type and adding custom fields to it.

Try going to Toolset > Custom Fields and creating a post fields group for the accommodation post type and adding some fields to it.

Edit an accommodation post on the back end. Can you see the field group and save the accommodation post with the extra fields?

If so, go to Toolset > Content Templates and create a template for single accommodation posts.

In the template output the post body, your custom fields, and try inserting some of the custom shortcodes the plugin makes available, then visit an accommodation post on the front end and check what works.

If you find things don't work, then let me know and I can try adding the plugin and testing myself.

#1163703

My issue is resolved now. Thank you!