SELECT SQL_CALC_FOUND_ROWS wpdw_posts.*, (
SELECT SUM(rooms_available) rooms_available FROM (SELECT IFNULL(SUM(room_count), 0) rooms_available, availabilities.accommodation_id FROM wpdw_byt_accommodation_vacancies availabilities INNER JOIN (
select d.the_date from
(
select adddate('2026-10-15',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) the_date from
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t0,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t1,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t2,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t3,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t4
having the_date between '2026-10-15' and '2028-10-15'
ORDER BY the_date
) d
where DATE(d.the_date) >= DATE(CURDATE())
group by d.the_date
order by d.the_date
) possible_dates ON (possible_dates.the_date >= DATE(availabilities.start_date) AND possible_dates.the_date < DATE(availabilities.end_date)) WHERE 1=1 AND ('2026-10-15' BETWEEN start_date AND end_date OR start_date <= '2028-10-15') AND end_date >= '2026-10-15' GROUP BY possible_dates.the_date, availabilities.accommodation_id ) as ra WHERE accommodation_id = wpdw_posts.ID ) rooms_available , (
SELECT IFNULL(SUM(rooms_booked), 0) rooms_booked FROM ((SELECT IFNULL(SUM(bookings.room_count), 0) rooms_booked, bookings.accommodation_id, possible_dates.the_date FROM wpdw_byt_accommodation_bookings bookings INNER JOIN (
select d.the_date from
(
select adddate('2026-10-15',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) the_date from
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t0,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t1,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t2,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t3,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t4
having the_date between '2026-10-15' and '2028-10-15'
ORDER BY the_date
) d
where DATE(d.the_date) >= DATE(CURDATE())
group by d.the_date
order by d.the_date
) possible_dates ON (possible_dates.the_date >= DATE(bookings.date_from) AND possible_dates.the_date < DATE(bookings.date_to)) WHERE 1=1 GROUP BY possible_dates.the_date, accommodation_id ) as rb, (SELECT MIN(start_date) min_start_date, MAX(end_date) max_end_date, accommodation_id FROM wpdw_byt_accommodation_vacancies GROUP BY accommodation_id) min_max_available_dates ) WHERE rb.accommodation_id = wpdw_posts.ID AND min_max_available_dates.accommodation_id = wpdw_posts.ID AND rb.the_date >= min_max_available_dates.min_start_date AND rb.the_date < min_max_available_dates.max_end_date ) rooms_booked , IFNULL((SELECT price_meta2.meta_value + 0 FROM wpdw_postmeta price_meta2 WHERE price_meta2.post_id=wpdw_posts.ID AND price_meta2.meta_key='_accommodation_min_price:2026-10-15:2028-10-15' LIMIT 1), 0) accommodation_price , IFNULL((SELECT price_meta3.meta_value + 0 FROM wpdw_postmeta price_meta3 WHERE price_meta3.post_id=wpdw_posts.ID AND price_meta3.meta_key='accommodation_static_from_price' LIMIT 1), 0) accommodation_static_price
FROM wpdw_posts INNER JOIN wpdw_postmeta ON ( wpdw_posts.ID = wpdw_postmeta.post_id )
WHERE 1=1 AND (
wpdw_postmeta.meta_key = 'accommodation_star_count'
) AND wpdw_posts.post_type = 'accommodation' AND ((wpdw_posts.post_status = 'publish'))
GROUP BY wpdw_posts.ID HAVING 1=1 AND rooms_available > rooms_booked AND rooms_available >= 1
ORDER BY wpdw_postmeta.meta_value+0 DESC
LIMIT 0, 24
Essential cookies enable basic functions and are necessary for the proper function of the website.
Name
Description
Duration
Cookie Preferences
This cookie is used to store the user's cookie consent preferences.
30 days
These cookies are needed for adding comments on this website.
Name
Description
Duration
comment_author
Used to track the user across multiple sessions.
Session
comment_author_email
Used to track the user across multiple sessions.
Session
comment_author_url
Used to track the user across multiple sessions.
Session
These cookies are used for managing login functionality on this website.
Name
Description
Duration
wordpress_logged_in
Used to store logged-in users.
Persistent
wordpress_sec
Used to track the user across multiple sessions.
15 days
wordpress_test_cookie
Used to determine if cookies are enabled.
Session
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
SourceBuster is used by WooCommerce for order attribution based on user source.
Name
Description
Duration
sbjs_session
The number of page views in this session and the current page path
30 minutes
sbjs_udata
Information about the visitor’s user agent, such as IP, the browser, and the device type
session
sbjs_first
Traffic origin information for the visitor’s first visit to your store (only applicable if the visitor returns before the session expires)
session
sbjs_current
Traffic origin information for the visitor’s current visit to your store
session
sbjs_first_add
Timestamp, referring URL, and entry page for your visitor’s first visit to your store (only applicable if the visitor returns before the session expires)
session
sbjs_current_add
Timestamp, referring URL, and entry page for your visitor’s current visit to your store
session
sbjs_migrations
Technical data to help with migrations between different versions of the tracking feature