Skip to content

Commit f760e70

Browse files
author
Chris Gårdenberg
committed
fix: Added Book-button to template B (event)
fixes #418
1 parent 644ed91 commit f760e70

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

content/template/listTemplate/blocks/event-block-b.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,27 @@ class="objectBlock brick <?php echo edu_get_percent_from_values( $spots_left, $e
5151
?>
5252
</div>
5353
<div class="objectBook">
54+
<?php
55+
if ( $show_book_btn ) {
56+
if ( $spots_left > 0 || 0 === intval( $event['MaxParticipantNumber'] ) ) {
57+
if ( $use_eduadmin_form ) {
58+
?>
59+
<a class="bookButton cta-btn" href="javascript://"
60+
onclick="edu_OpenEduBookingFormModal('<?php echo esc_js( $event['BookingFormUrl'] ); ?>');"><?php _ex( 'Book', 'frontend', 'eduadmin-booking' ); ?></a>
61+
<?php
62+
} else {
63+
?>
64+
<a class="bookButton cta-btn"
65+
href="<?php echo $base_url; ?>/<?php echo make_slugs( $name ); ?>__<?php echo $object['CourseTemplateId']; ?>/book/?eid=<?php echo $event['EventId']; ?><?php echo edu_get_query_string( "&" ) . '&_=' . time(); ?>"><?php _ex( 'Book', 'frontend', 'eduadmin-booking' ); ?></a>
66+
<?php
67+
}
68+
} else {
69+
?>
70+
<i class="fullBooked"><?php _ex( 'Full', 'frontend', 'eduadmin-booking' ); ?></i>
71+
<?php
72+
}
73+
}
74+
?>
5475
<?php if ( $show_read_more_btn ) : ?>
5576
<a class="readMoreButton cta-btn"
5677
href="<?php echo esc_url( $base_url . '/' . make_slugs( $name ) . '__' . $object['CourseTemplateId'] . '/?eid=' . $event['EventId'] . edu_get_query_string( '&' ) ); ?>"><?php echo esc_html_x( 'Read more', 'frontend', 'eduadmin-booking' ); ?></a>

0 commit comments

Comments
 (0)