Wrong behaviour of search results

  • This topic has 35 replies, 16 voices, and was last updated 1 day, 13 hours ago by Martin Fourdrignier.
Viewing 6 posts - 31 through 36 (of 36 total)
  • Author
    Posts
  • #1455025
    Adrianna Schmitt
    Participant

    please add my upvote to this feature.

    #1475281
    Rolando Rodrigues
    Participant

    It is not normal that the result of the search does not take into account the total capacity… it must be changed as soon as possible.
    Add my upvote to this feature.

    #1476169
    J. Davis
    Keymaster

    Thanks for your feedback. Your upvote has been added.

    #1481545
    Jo Minney
    Participant

    Please add my upvote to this feature. It’s wild that we’ve been waiting for three years for this – especially when someone as literally already given you the code to make it work. You just need to make it part of your plugin so we don’t need to hack the plugin code every time we do an update. Do better.

    #1485348
    J. Davis
    Keymaster

    Hi, your upvote has been added.

    #1606510
    Martin Fourdrignier
    Participant

    Hi,
    I was using the tweak proposed by Jeffrey Donchez in April 2021. It was working perfectly (I had to re-upload the modified file search-results-shortcode.php at each update, which is only a minor inconvenience) until the update from version 4.8.8. Now, I get the following fatal error:

    Fatal error: Uncaught Error: Call to undefined method HotelBookingPlugin::getRulesChecker() in /home/customer/www/coquelicot.com/public_html/wp-content/plugins/motopress-hotel-booking/includes/shortcodes/search-results-shortcode.php:598 Stack trace: #0 /home/customer/www/coquelicot.com/public_html/wp-content/plugins/motopress-hotel-booking/includes/shortcodes/search-results-shortcode.php(502): MPHB\Shortcodes\SearchResultsShortcode->parseCheckOutDate('2024-06-29') #1 /home/customer/www/coquelicot.com/public_html/wp-content/plugins/motopress-hotel-booking/includes/shortcodes/search-results-shortcode.php(472): MPHB\Shortcodes\SearchResultsShortcode->parseInputData(Array) #2 /home/customer/www/coquelicot.com/public_html/wp-content/plugins/motopress-hotel-booking/includes/shortcodes/search-results-shortcode.php(516): MPHB\Shortcodes\SearchResultsShortcode->setupSearchData() #3 /home/customer/www/coquelicot.com/public_html/wp-includes/class-wp-hook.php(324): MPHB\Shortcodes\SearchResultsShortcode->setup(Object(WP)) #4 /home/cu in /home/customer/www/coquelicot.com/public_html/wp-content/plugins/motopress-hotel-booking/includes/shortcodes/search-results-shortcode.php on line 598

    Any idea of the changes introduced since then in the search results shortcode and how to adapt the tweak from Jeffrey? (I include it below for reference)

    Thanks in advance

    Kind regards,

    Martin

    in includes/shortcodes/search-results-shortcode.php
    around line 303 search for :
    $where = ” WHERE 1=1″
    before that, insert:

    // added for Capacity Search
    $join .= ” INNER JOIN {$wpdb->postmeta} AS room_capacity_ids ON room_types.ID = room_capacity_ids.post_id AND room_capacity_ids.meta_key = ‘mphb_total_capacity’ “;
    then search for: (should now be around line 320)
    $order = ” GROUP BY room_type_ids.meta_value”
    before that, insert:
    // added for Capacity Search
    $where .= “and room_capacity_ids.meta_value >= “.$_REQUEST[‘mphb_adults’].” “;
Viewing 6 posts - 31 through 36 (of 36 total)
  • You must be logged in to reply to this topic.