Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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.
<?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;
}
<?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
You can’t perform that action at this time.