diff --git a/ext/eventcart/CRM/Event/Cart/PageCallback.php b/ext/eventcart/CRM/Event/Cart/PageCallback.php index e145e8235058..5b592abc085e 100644 --- a/ext/eventcart/CRM/Event/Cart/PageCallback.php +++ b/ext/eventcart/CRM/Event/Cart/PageCallback.php @@ -28,6 +28,15 @@ public static function alterEventInfo($event) { $event->page->assign('registerText', $registerText); $event->page->assign('registerURL', $url); + + // For the "View Cart" and "Checkout" buttons + $cart = CRM_Event_Cart_BAO_Cart::find_or_create_for_current_session(); + $cart->load_associations(); + $events = $cart->get_main_events_in_carts(); + $event->page->assign('eventcart_has_events', !empty($events)); + + CRM_Core_Region::instance('event-page-eventinfo-actionlinks-top') + ->add(['template' => 'CRM/Event/Cart/eventinfo.tpl']); } public static function alterEventList($event) { diff --git a/ext/eventcart/templates/CRM/Event/Cart/eventinfo.tpl b/ext/eventcart/templates/CRM/Event/Cart/eventinfo.tpl new file mode 100644 index 000000000000..7ef086a6de18 --- /dev/null +++ b/ext/eventcart/templates/CRM/Event/Cart/eventinfo.tpl @@ -0,0 +1,13 @@ +
+ + + {if $eventcart_has_events} + + {/if} +
+{literal} + +{/literal}