Change attributes field type

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1032533
    Mario Ciambelli
    Participant

    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

    #1034402
    Andre Flores
    Moderator

    Hello 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

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.