Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking How to add custom fields to the “Add accomodation type interface”
- This topic has 7 replies, 4 voices, and was last updated 3 years, 1 month ago by Andre Flores.
- AuthorPosts
- December 16, 2020 at 1:40 pm #1047764Martin FourdrignierParticipant
Good afternoon everyone,
I’m in the process of building a multi-properties website with Divi and Motopress Hotel Booking Plugin.
I would like to add some info to be displayed by default on single accomodation pages, like icons depending on amenities available (5-6 key amenities like pool, dogs welcome…), location map, description splitted into different paragraphs…
I imagine that the best way to do so would be to add custom fields in the interface dedicated to the creation of a new accomodation (or adding it in the code of the page and then inserting for each property in the SQL database directly?), but would welcome guidances on that point!
Many thanks in advance
Martin
December 17, 2020 at 10:01 am #1048101Andre FloresModeratorHello Martin,
You may try the ACF plugin, which allows such possibility. However, note that it may require advanced knowledge in coding to output your custom fields on the accommodation type pages.
Regards,
AndreDecember 17, 2020 at 6:04 pm #1048428Martin FourdrignierParticipantMany thanks for your great help Andre! As I work with Divi, it is quite simple to do!
Thanks again for your help!
Best,
MartinDecember 17, 2020 at 9:15 pm #1048485Martin FourdrignierParticipantHi again,
I figured out how to build a custom accomodation type template with Divi and make WordPress use by default. My page uses custom fields to add some information dynamically depending on the accomodation. I also use some of the info asked by the Hotel Booking Plugin.
However, I can’t use shortcodes in my template, as I am unable to get the accomodation ID dynamically in the template, what is quite problematic regarding the display of availability calendar.
I don’t understand because the default accomodation type page of Hotel Plugin do that by default (ie: getting the ID of the accomodation related to the current page and displaying the gallery, and so on, without entering the ID again).
Would you have an idea on how to do that? I tried to use the shortcodes with a $post_id but it was unsuccessful.
Many thanks!
December 18, 2020 at 7:35 am #1048563Andre FloresModeratorHello Martin,
I would ask that you submit your request to our Help Desk providing temporary access to your WordPress dashboard, so we take a closer look at the issue.
Regards,
AndreJuly 29, 2021 at 11:30 am #1164001Ace SuaresParticipantstatic function get_availability_calendar($args = array()){
$defaults = array(
‘id’ => ”,
‘monthstoshow’ => ‘2,3’,
‘class’ => ”
);$args = wp_parse_args($args, $defaults);
// add this line
$args[‘id’] = get_the_ID();if($args[‘id’] !== ”){
return do_shortcode(‘[mphb_availability_calendar class=”‘.$args[‘class’].'” id=”‘.$args[‘id’].'” monthstoshow=”‘.$args[‘monthstoshow’].'”]’);
}return esc_html__(‘Please insert accommodation id.’);
}
September 26, 2021 at 10:01 am #1191175Robert BalParticipantThis reply has been marked as private.September 30, 2021 at 7:00 am #1193294Andre FloresModeratorThis reply has been marked as private. - AuthorPosts
- You must be logged in to reply to this topic.