How to add custom fields to the “Add accomodation type interface”

Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking How to add custom fields to the “Add accomodation type interface”

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1047764
    Martin Fourdrignier
    Participant

    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

    #1048101
    Andre Flores
    Moderator

    Hello 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,
    Andre

    #1048428
    Martin Fourdrignier
    Participant

    Many thanks for your great help Andre! As I work with Divi, it is quite simple to do!
    Thanks again for your help!
    Best,
    Martin

    #1048485
    Martin Fourdrignier
    Participant

    Hi 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!

    #1048563
    Andre Flores
    Moderator

    Hello 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,
    Andre

    #1164001
    Ace Suares
    Participant

    static 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.’);

    }

    #1191175
    Robert Bal
    Participant
    This reply has been marked as private.
    #1193294
    Andre Flores
    Moderator
    This reply has been marked as private.
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.