/** * _process_action * * @access private * @return void */ private function _process_form_action() { // what cha wanna do? switch ($this->checkout->action) { // AJAX next step reg form case 'display_spco_reg_step': $this->checkout->redirect = FALSE; if (EE_Registry::instance()->REQ->ajax) { $this->checkout->json_response->set_reg_step_html($this->checkout->current_step->display_reg_form()); } break; default: // meh... do one of those other steps first if (!empty($this->checkout->action) && is_callable(array($this->checkout->current_step, $this->checkout->action))) { // dynamically creates hook point like: AHEE__Single_Page_Checkout__before_attendee_information__process_reg_step do_action("AHEE__Single_Page_Checkout__before_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step); // call action on current step if (call_user_func(array($this->checkout->current_step, $this->checkout->action))) { // good registrant, you get to proceed if ($this->checkout->current_step->success_message() != '') { if (apply_filters('FHEE__Single_Page_Checkout___process_form_action__display_success', false)) { EE_Error::add_success($this->checkout->current_step->success_message() . '<br />' . $this->checkout->next_step->_instructions()); } } // pack it up, pack it in... $this->_setup_redirect(); } // dynamically creates hook point like: AHEE__Single_Page_Checkout__after_payment_options__process_reg_step do_action("AHEE__Single_Page_Checkout__after_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step); } else { EE_Error::add_error(sprintf(__('The requested form action "%s" does not exist for the current "%s" registration step.', 'event_espresso'), $this->checkout->action, $this->checkout->current_step->name()), __FILE__, __FUNCTION__, __LINE__); } // end default } // store our progress so far $this->checkout->stash_transaction_and_checkout(); // advance to the next step! If you pass GO, collect $200 $this->go_to_next_step(); }
/** * update_checkout with changes that have been made to the cart * @return void */ public function update_checkout() { // grab the cart grand total and reset TXN total $this->checkout->transaction->set_total($this->checkout->cart->get_cart_grand_total()); $this->checkout->stash_transaction_and_checkout(); }