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 3 posts - 1 through 3 (of 3 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

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