/** * _load_and_instantiate_reg_steps * instantiates each reg step based on the loaded reg_steps array * * @access private * @throws EE_Error * @return bool */ private function _load_and_instantiate_reg_steps() { // have reg_steps already been instantiated ? if (empty($this->checkout->reg_steps) || apply_filters('FHEE__Single_Page_Checkout__load_reg_steps__reload_reg_steps', false, $this->checkout)) { // if not, then loop through raw reg steps array foreach (EED_Single_Page_Checkout::$_reg_steps_array as $order => $reg_step) { if (!$this->_load_and_instantiate_reg_step($reg_step, $order)) { return false; } } EE_Registry::instance()->CFG->registration->skip_reg_confirmation = TRUE; EE_Registry::instance()->CFG->registration->reg_confirmation_last = TRUE; // skip the registration_confirmation page ? if (EE_Registry::instance()->CFG->registration->skip_reg_confirmation) { // just remove it from the reg steps array $this->checkout->remove_reg_step('registration_confirmation', false); } else { if (EE_Registry::instance()->CFG->registration->reg_confirmation_last && isset($this->checkout->reg_steps['registration_confirmation'])) { // set the order to something big like 100 $this->checkout->set_reg_step_order('registration_confirmation', 100); } } // filter the array for good luck $this->checkout->reg_steps = apply_filters('FHEE__Single_Page_Checkout__load_reg_steps__reg_steps', $this->checkout->reg_steps); // finally re-sort based on the reg step class order properties $this->checkout->sort_reg_steps(); } else { foreach ($this->checkout->reg_steps as $reg_step) { // set all current step stati to FALSE $reg_step->set_is_current_step(FALSE); } } if (empty($this->checkout->reg_steps)) { EE_Error::add_error(__('No Reg Steps were loaded..', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); return false; } // make reg step details available to JS $this->checkout->set_reg_step_JSON_info(); return true; }