How to Force Load Reservation Table Assets

By default, the assets needed (CSS, JS, etc) to make the reservation table work are automatically loaded on the page where the reservation table shortcode is used. They are not loaded on those pages where the reservation table shortcode is not found. This is done for performance reasons.

So if you load the reservation table using a third-party plugin like a popup plugin, then Delivery Slots might not be able to determine the presence of shortcode, and the required assets won’t be loaded.

To fix this problem you can use this code snippet:

function iconic_wds_conditionally_load_reservation_table_assets( $load ) {
	// Replace 19 with the page ID.
	if ( is_page( 19 ) ) {
		return true;
	}

	return $load;
}
add_filter( 'iconic_wds_force_load_reservation_calendar_assets', 'iconic_wds_conditionally_load_reservation_table_assets' );

Please replace 19 with the page ID where you are using the reservation table.

If you want to load reservation table assets on the whole website then you can use this code snippet:

<?php
add_filter( 'iconic_wds_force_load_reservation_calendar_assets', '__return_true' );

WooCommerce Delivery Slots

Choose a delivery date and time for each order. Add a limit to the number of allowed reservations, restrict time slots to specific delivery methods, and so much more.

Was this helpful?

Please let us know if this article was useful. It is the best way to ensure our documentation is as helpful as possible.