drupal-civicrm/sites/all/modules/civicrm/CRM/Event/Cart/Page/ViewCart.php
2018-01-14 13:10:16 +00:00

24 lines
538 B
PHP

<?php
/**
* Class CRM_Event_Cart_Page_ViewCart
*/
class CRM_Event_Cart_Page_ViewCart extends CRM_Core_Page {
/**
* @return string
*/
public function run() {
$transaction = new CRM_Core_Transaction();
$cart = CRM_Event_Cart_BAO_Cart::find_or_create_for_current_session();
$cart->load_associations();
$this->assign('events_in_carts', $cart->get_main_events_in_carts());
$this->assign('events_count', count($cart->get_main_events_in_carts()));
$transaction->commit();
return parent::run();
}
}