Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking Using mphb_rooms shortcode – can I order by price?
- This topic has 7 replies, 4 voices, and was last updated 3 years, 6 months ago by Andre Flores.
- AuthorPosts
- 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.
Default: dateIs there any way I can do this?
February 24, 2021 at 1:20 am #1079596Andre FloresModeratorHello 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,
AndreFebruary 24, 2021 at 2:28 am #1079639Ian WestParticipantThanks 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
February 26, 2021 at 12:54 am #1080855Andre FloresModeratorHello 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,
AndreMarch 20, 2021 at 4:16 am #1092834Maria SarantinouParticipantHi Ian,
I’m looking for the same functionality, would you mind to explain me how you did it?Really appreciate
April 26, 2021 at 1:43 am #1111704Andre FloresModeratorHello 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,
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. - AuthorPosts
- You must be logged in to reply to this topic.