Last active
September 10, 2018 19:59
-
-
Save joshfeck/82287013af2aa3eb43e0765563d972cb to your computer and use it in GitHub Desktop.
Add the following code snippet and file to your site specific plugin. Adds a first step to the progress display at the top of the Event Espresso Single Page checkout. The step is skipped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //* Please do NOT include the opening php tag, except of course if you're starting with a blank file | |
| add_action( | |
| 'AHEE__EE_System__load_espresso_addons__complete', | |
| 'my_add_extra_step_class_autoloader' | |
| ); | |
| function my_add_extra_step_class_autoloader() { | |
| EEH_Autoloader::instance()->register_autoloader( | |
| array( | |
| 'EE_SPCO_Reg_Step_Add_Extra_Step' => | |
| plugin_dir_path( __FILE__ ) . 'EE_SPCO_Reg_Step_Add_Extra_Step.class.php' | |
| ) | |
| ); | |
| } | |
| add_filter( 'AHEE__SPCO__load_reg_steps__reg_steps_to_load', 'ee_add_extra_reg_step' ); | |
| function ee_add_extra_reg_step($reg_steps) | |
| { | |
| array_unshift( | |
| $reg_steps, | |
| array( | |
| 'file_path' => plugin_dir_path( __FILE__ ), | |
| 'class_name' => 'EE_SPCO_Reg_Step_Add_Extra_Step', | |
| 'slug' => 'select_tickets', | |
| 'has_hooks' => false, | |
| ) | |
| ); | |
| return $reg_steps; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class EE_SPCO_Reg_Step_Add_Extra_Step extends EE_SPCO_Reg_Step | |
| { | |
| /** | |
| * constructor | |
| * | |
| * @param EE_Checkout $checkout | |
| */ | |
| public function __construct(EE_Checkout $checkout) | |
| { | |
| $this->_slug = 'select_tickets'; | |
| $this->_name = 'Register'; | |
| $this->_template = ''; | |
| $this->checkout = $checkout; | |
| $this->_reset_success_message(); | |
| } | |
| public function translate_js_strings() | |
| { | |
| } | |
| public function enqueue_styles_and_scripts() | |
| { | |
| } | |
| /** | |
| * Initialize the reg step | |
| * | |
| * @return boolean | |
| */ | |
| public function initialize_reg_step() | |
| { | |
| $this->checkout->skip_reg_step($this->_slug); | |
| return false; | |
| } | |
| public function generate_reg_form() | |
| { | |
| } | |
| public function process_reg_step() | |
| { | |
| $this->set_completed(); | |
| return true; | |
| } | |
| public function update_reg_step() | |
| { | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment