Support

Home Forums Event Espresso Premium Add Second Registration Page

Add Second Registration Page

Posted: November 12, 2015 at 9:09 am

Viewing 4 reply threads


Jeff Long

November 12, 2015 at 9:09 am

Hey there!

The main thrust of my query is this: EE4 doesn’t allow users to upload files during registration and I need a workaround.

Plus – there are activities that I would like to require as users register for events. Since EE will probably start adding features (like file uploads) over time, it doesn’t seem wise or worth the while to try to hook such complex functions into EE.

A great workaround, it seems to me, would be to simply add an additional step (page – real or dynamically populated through templates) to the registration process.

Is there a way to interrupt the registration flow from:

1) Add event to cart & click Add to Event Cart
2) Click Proceed to Event Registration
3) Complete Registration form and click Proceed to Payment Options
4) Select Payment method & click Proceed to Finalize Registration

to:

1) Add event to cart & click Add to Event Cart
2) Click Proceed to Event Registration
3) Complete Registration form and click “Proceed”
4) Load custom page – take actions – and click Proceed to Payment Options
5) Select Payment method & click Proceed to Finalize Registration

OR is there a much better, simpler way for adding a step to user checkouts?


Josh

  • Support Staff

November 12, 2015 at 1:29 pm

Hi Jeff,

It turns out that the WP User Integration adds a step between the ticket selection and registration form when it prompts the registrant to log in when it’s an event that’s set to require being logged in to register.

I recommend checking out the code in the WP Users add-on to see how it adds the step.


Jeff Long

November 13, 2015 at 8:27 am

Hey! That’s great. I think I’m seeing most of what’s going on here. I’m trying to strip the plugin down to a simpler version that would allow me to add a new ‘blank page’ to the registration process.

I’ve created a plugin with three files:

The Initializer:

<?php

if ( ! defined( 'ABSPATH' ) )
exit( 'No direct script access allowed' );
/*
Plugin Name: Event Espresso - Custom Functions
*/

define( 'EE_CF_VERSION', '1.0' );
define( 'EE_CF_PLUGIN_FILE', __FILE__ );

function load_ee_cf() {
if ( class_exists( 'EE_Addon' ) ) {
// new_addon version
require_once ( plugin_dir_path( __FILE__ ) . 'EE_CF.class.php' );
EE_CF::register_addon();
}

}

add_action( 'AHEE__EE_System__load_espresso_addons', 'load_ee_cf' );

The CLASS


<?php

if (!defined('ABSPATH'))
exit('No direct script access allowed');

//define constants
define( 'EE_CF_PATH', plugin_dir_path( __FILE__ ) );
define( 'EE_CF_URL', plugin_dir_url( __FILE__ ) );
define( 'EE_CF_TEMPLATE_PATH', EE_CF_PATH . 'templates/' );

/**
* Class definition for the EE_CFunz object
*
* @since 1.0.0
* @package EE WPUsers
*/
class EE_CF extends EE_Addon {

/**
* Set up
*/
public static function register_addon() {
// register addon via Plugin API
EE_Register_Addon::register(
'EE_CF', array(
'version' => EE_CF_VERSION,
'min_core_version' => '4.6.0.alpha',
'main_file_path' => EE_CF_PLUGIN_FILE,
// 'config_class' => 'EE_C_Config',
'config_name' => 'custom_functions',
// 'module_paths' => array(),
// 'shortcode_paths' => array(),
// 'dms_paths' => array( EE_CF_PATH . 'core/data_migration_scripts' ),
'autoloader_paths' => array(
'EE_SPCO_Reg_Step_WP_User_Login' => EE_CF_PATH . 'EE_SPCO_Reg_Step_CF.class.php',
)

)
);
}

}

// end of class EE_CFunz

And the REGISTRATION STEP CLASS


<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
/**
*
* Class EE_SPCO_Reg_Step_CF
*
*
*/
class EE_SPCO_Reg_Step_CF extends EE_SPCO_Reg_Step {

/**
* constructor
*
* @param EE_Checkout $checkout
*/
public function __construct( EE_Checkout $checkout ) {
$this->_slug = 'wpuser_cf';
$this->_name = __('cfunz', 'event_espresso');
$this->_template = '';
$this->checkout = $checkout;
$registration_url = ! EE_Registry::instance()->CFG->addons->custom_functions->registration_page ? wp_registration_url() : EE_Registry::instance()->CFG->addons->custom_functions->registration_page;
}

public function translate_js_strings() {}

public function enqueue_styles_and_scripts() {
EED_WP_Users_SPCO::enqueue_scripts_styles( EED_Single_Page_Checkout::instance() );
}

/**
* Initialize the reg step
*
* @return void
*/
public function initialize_reg_step() {
consol.log("initialized new reg step");
}

public function generate_reg_form() {
consol.log("generate new reg form");
}

public function process_reg_step() {
consol.log("process reg step");
}

public function update_reg_step() {}

} // end class EE_SPCO_Reg_Step_CF

I know that in your wonderful plugin, you reach out to several modules, templates, and other assets to create the awesome UX that Event Espresso has.

But – is there a shortcut or specific function that you can point me to that I could fit into my REGISTRATION STEP CLASS file to open a new ‘page/step’ that includes a “continue” button?


Jeff Long

November 13, 2015 at 8:31 am

Ooof. Reposting with (hopefully) better formatting.

Hey! That’s great. I think I’m seeing most of what’s going on here. I’m trying to strip the plugin down to a simpler version that would allow me to add a new ‘blank page’ to the registration process.

I’ve created a plugin with three files:

The Initializer:

<?php
if ( ! defined( 'ABSPATH' ) )
exit( 'No direct script access allowed' );
/*
Plugin Name: Event Espresso - Custom Functions
*/
define( 'EE_CF_VERSION', '1.0' );
define( 'EE_CF_PLUGIN_FILE', __FILE__ );
function load_ee_cf() {
if ( class_exists( 'EE_Addon' ) ) {
// new_addon version
require_once ( plugin_dir_path( __FILE__ ) . 'EE_CF.class.php' );
EE_CF::register_addon();
}
}
add_action( 'AHEE__EE_System__load_espresso_addons', 'load_ee_cf' );

The CLASS

<?php
if (!defined('ABSPATH'))
exit('No direct script access allowed');
//define constants
define( 'EE_CF_PATH', plugin_dir_path( __FILE__ ) );
define( 'EE_CF_URL', plugin_dir_url( __FILE__ ) );
define( 'EE_CF_TEMPLATE_PATH', EE_CF_PATH . 'templates/' );
/**
* Class definition for the EE_CFunz object
*
* @since 1.0.0
* @package EE WPUsers
*/
class EE_CF extends EE_Addon {
/**
* Set up
*/
public static function register_addon() {
// register addon via Plugin API
EE_Register_Addon::register(
'EE_CF', array(
'version' => EE_CF_VERSION,
'min_core_version' => '4.6.0.alpha',
'main_file_path' => EE_CF_PLUGIN_FILE,
// 'config_class' => 'EE_C_Config',
'config_name' => 'custom_functions',
// 'module_paths' => array(),
// 'shortcode_paths' => array(),
// 'dms_paths' => array( EE_CF_PATH . 'core/data_migration_scripts' ),
'autoloader_paths' => array(
'EE_SPCO_Reg_Step_WP_User_Login' => EE_CF_PATH . 'EE_SPCO_Reg_Step_CF.class.php',
)
)
);
}
}
// end of class EE_CFunz

And the REGISTRATION STEP CLASS

<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
/**
*
* Class EE_SPCO_Reg_Step_CF
*
*
*/
class EE_SPCO_Reg_Step_CF extends EE_SPCO_Reg_Step {
/**
* constructor
*
* @param EE_Checkout $checkout
*/
public function __construct( EE_Checkout $checkout ) {
$this->_slug = 'wpuser_cf';
$this->_name = __('cfunz', 'event_espresso');
$this->_template = '';
$this->checkout = $checkout;
$registration_url = ! EE_Registry::instance()->CFG->addons->custom_functions->registration_page ? wp_registration_url() : EE_Registry::instance()->CFG->addons->custom_functions->registration_page;
}
public function translate_js_strings() {}
public function enqueue_styles_and_scripts() {
EED_WP_Users_SPCO::enqueue_scripts_styles( EED_Single_Page_Checkout::instance() );
}
/**
* Initialize the reg step
*
* @return void
*/
public function initialize_reg_step() {
consol.log("initialized new reg step");
}
public function generate_reg_form() {
consol.log("generate new reg form");
}
public function process_reg_step() {
consol.log("process reg step");
}
public function update_reg_step() {}
} // end class EE_SPCO_Reg_Step_CF

I know that in your wonderful plugin, you reach out to several modules, templates, and other assets to create the awesome UX that Event Espresso has.

But – is there a shortcut or specific function that you can point me to that I could fit into my REGISTRATION STEP CLASS file to open a new ‘page/step’ that includes a “continue” button?


Josh

  • Support Staff

November 27, 2015 at 8:20 am

I can point you to the hook that you can use to hook into the checkout for adding your additional registration step. It’s the
AHEE__SPCO__load_reg_steps__reg_steps_to_load hook. A good way to see how WP users adds its step is start by looking at how it uses the hook in EED_WP_Users_SPCO.module.php:74, then follow its methods back.

Viewing 4 reply threads

The support post ‘Add Second Registration Page’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso