- This topic has 7 replies, 4 voices, and was last updated 2 months, 2 weeks ago by Andre Flores.
- February 23, 2021 at 3:49 am #1078852Ian WestParticipant
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.
Is there any way I can do this?February 24, 2021 at 1:20 am #1079596Andre FloresModerator
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.
AndreFebruary 24, 2021 at 2:28 am #1079639Ian WestParticipant
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.
IanFebruary 26, 2021 at 12:54 am #1080855Andre FloresModerator
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.
AndreMarch 20, 2021 at 4:16 am #1092834Maria SarantinouParticipant
I’m looking for the same functionality, would you mind to explain me how you did it?
Really appreciateApril 26, 2021 at 1:43 am #1111704Andre FloresModerator
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.
AndreMay 10, 2021 at 11:10 pm #1119091Preeyanka GandhiParticipantThis reply has been marked as private.May 13, 2021 at 1:18 am #1120509Andre FloresModeratorThis reply has been marked as private.
- You must be logged in to reply to this topic.