| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template: Open hours. |
| 4 |
* |
| 5 |
* @package Orderable/Templates |
| 6 |
*/ |
| 7 |
|
| 8 |
defined( 'ABSPATH' ) || exit; |
| 9 |
|
| 10 |
if ( empty( $args['upcoming_open_hours'] ) ) { |
| 11 |
return; |
| 12 |
} ?> |
| 13 |
|
| 14 |
<table class="orderable-open-hours"> |
| 15 |
<tbody> |
| 16 |
<?php foreach ( $args['upcoming_open_hours'] as $open_hour ) { ?> |
| 17 |
<tr class="orderable-open-hours__day"> |
| 18 |
<th class="orderable-open-hours__day-name"> |
| 19 |
<?php if ( $args['date'] ) { ?> |
| 20 |
<span class="orderable-open-hours__date"><?php echo esc_attr( $open_hour['date'] ); ?></span> |
| 21 |
<?php } ?> |
| 22 |
|
| 23 |
<?php echo esc_attr( $open_hour['day'] ); ?> |
| 24 |
</th> |
| 25 |
<td class="orderable-open-hours__hours"> |
| 26 |
<span class="orderable-open-hours__hours-text orderable-open-hours__hours-text--<?php echo $open_hour['is_closed'] ? 'closed' : 'open'; ?>"><?php echo $open_hour['hours']; ?></span> |
| 27 |
|
| 28 |
<?php if ( $args['services'] && ! empty( $open_hour['services'] ) && ! $open_hour['is_closed'] ) { ?> |
| 29 |
<?php foreach ( $open_hour['services'] as $service => $active ) { ?> |
| 30 |
<span class="orderable-open-hours__service orderable-open-hours__service--<?php echo esc_attr( $service ); ?> orderable-open-hours__service--<?php echo $active ? 'open' : 'closed'; ?>"><?php echo wp_kses_post( Orderable_Services::get_service_label( $service ) ); ?></span> |
| 31 |
<?php } ?> |
| 32 |
<?php } ?> |
| 33 |
</td> |
| 34 |
</tr> |
| 35 |
<?php } ?> |
| 36 |
</tbody> |
| 37 |
</table> |
| 38 |
|