Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking Change attributes field type
- This topic has 1 reply, 2 voices, and was last updated 4 years ago by Andre Flores.
- AuthorPosts
- November 19, 2020 at 4:03 pm #1032533Mario CiambelliParticipant
Hi everybody.
Thank you for this wonderful plugin.I have a question: I do need to manage a huge list of different locations. I did set my filters in the home page such as Check in date, check out date, guests and location.
Is there a way to have the locations field as a search bar instead of showing a long selection dropdown list?
Thank you in advance.
Mario
November 24, 2020 at 10:42 am #1034402Andre FloresModeratorHello Mario,
Unfortunately, currently there is no option to use other field types for the attributes in the availability search form. Changing it would require custom coding, however, if you have some sufficient knowledge in PHP, you may try copying the search-form.php file from /wp-content/plugins/motopress-hotel-booking/templates/shortcodes/search/ to /wp-content/themes/your_theme/hotel-booking/shortcodes/search/ directory and performing necessary changes on lines 118-123.
<select id="<?php echo esc_attr( 'mphb_' . $attributeName . '-' . $uniqid ); ?>" name="<?php echo esc_attr( 'mphb_attributes[' . $attributeName . ']' ); ?>"> <option value=""><?php echo mphb_attribute_default_text( $attributeName ); ?></option> <?php foreach ( $terms as $termId => $termLabel ) { ?> <option value="<?php echo esc_attr( $termId ); ?>"><?php echo esc_html( $termLabel ); ?></option> <?php } ?> </select>
If somebody has had an experience of changing the attributes field type, feel free to share it by commenting below.
Regards,
Andre - AuthorPosts
- You must be logged in to reply to this topic.