Using mphb_rooms shortcode – can I order by price?

Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking Using mphb_rooms shortcode – can I order by price?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1078852
    Ian West
    Participant

    I have a site where I’m displaying selections of villas using mphb_rooms shortcode.
    I want to display the list by price, but that value doesn’t seem to be an option in:

    orderby Sort by.
    Values: ID, title, date, menu_order. See the full list.
    Default: date

    Is there any way I can do this?

    #1079596
    Andre Flores
    Moderator

    Hello Ian,

    There is no ordering by price option in the [mphb_rooms] shortcode indeed. You may try ordering accommodations by menu_order and set the ordering for each accommodation type matching the pricing order: https://prnt.sc/105kcpl.

    Regards,
    Andre

    #1079639
    Ian West
    Participant

    Thanks Andre,
    It’s a shame we can’t do it with the mphb_rooms shortcode, though it’s available in the [mphb_search_results] shortcode.

    Anyway, I have solved it by adding a custom price field in the accommodation type page with ACF. I then added it as meta_key and used the ‘ordrby’ argument to sort by meta_value – numeric.

    Ian

    #1080855
    Andre Flores
    Moderator

    Hello Ian,

    Thank you for your feedback, it is much appreciated. The reason sorting by price is not available for the rooms listing shortcode is that price may vary depending on selected dates and number of guests, so the order will not always be correct anyway.
    We will take your suggestion into consideration for future plugin updates though.

    Regards,
    Andre

    #1092834
    Maria Sarantinou
    Participant

    Hi Ian,
    I’m looking for the same functionality, would you mind to explain me how you did it?

    Really appreciate

    #1111704
    Andre Flores
    Moderator

    Hello there,

    I am delighted to let you know that ordering by price is now available in the Hotel Booking plugin starting from v. 3.9.6. Make sure to update the plugin to the latest version in order to have that option.

    Regards,
    Andre

    #1119091
    Preeyanka Gandhi
    Participant
    This reply has been marked as private.
    #1120509
    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.