Support

Home Forums Event Espresso Premium WP User Integration Help Filter Hooks

WP User Integration Help Filter Hooks

Posted: May 23, 2018 at 12:30 am

Viewing 10 reply threads


Jarred

May 23, 2018 at 12:30 am

Currently, with the WP User Integration plugin my developer found out that it will only allow users to login from the wp-login.php page.

Is there a hook or filter that will allow me to create an intermediate page once someone goes to the cart. This intermediate page will either ask for registration (directly taken to step 2 of the cart) or login (if they login), will take them directly to the Step 3 i.e Payment.

Also, are there any hooks to pull more info besides just the name and email address. just anything that makes the checkout faster and easier for repeat customers.

Thank You.


Tony

  • Support Staff

May 23, 2018 at 5:48 am

Hi Jarred,

Currently, with the WP User Integration plugin my developer found out that it will only allow users to login from the wp-login.php page.

May I ask why your developer believes this?

There is an option within the WP User intergration settings that allows you to set a custom registration page:

Event Espresso -> Registration form -> User integration settings -> Registration Page URL (if different from default WordPress Registration).

Set the URL that you can the user to be sent to for registration there and EE will direct them there.

Is there a hook or filter that will allow me to create an intermediate page once someone goes to the cart. This intermediate page will either ask for registration (directly taken to step 2 of the cart) or login (if they login), will take them directly to the Step 3 i.e Payment.

There are plenty of hooks within EE and you can add your own steps into SPCO but we cannot provide support for custom development. Has your developer had a look over the documentation here?

Also, are there any hooks to pull more info besides just the name and email address. just anything that makes the checkout faster and easier for repeat customers.

You don’t need hooks to pull that info in, but it really depends on the specifics of what you are doing.

Are you requiring that users log in before they register onto an event? If they log in and then register onto the event their ‘personal information’ details will already be prefilled, we have a snippet that can be used to pull in any answers to custom questions that may have been answer before in their last registration if that is what you are looking for?

https://github.com/eventespresso/ee-code-snippet-library/blob/master/addons/eea-wp-user/mn_wp_user_addon_save_custom_answers_too.php

Add that to a custom functions plugin and EE will pull their last used answer for any questions on the registration form.


Jarred

May 31, 2018 at 12:03 am

Hi,
Can I have a custom Login page and is there a shortcode to insert on the custom login page to work with WP-User Integration.


Tony

  • Support Staff

May 31, 2018 at 2:23 am

A custom login page from where?

Can you add a screenshot of what it is you want to change?

https://eventespresso.com/wiki/troubleshooting-checklist/#screenshots

You can have a custom login page, but it depends on what you actually mean with the above.

As for:

is there a shortcode to insert on the custom login page to work with WP-User Integration

You mean a profile page? I which case it would be [ESPRESSO_MY_EVENTS], I’m not sure what you would add to a login page from the WP user integration add-on.

Again a screenshot of what you are trying to do may help here.


Jarred

May 31, 2018 at 5:20 pm

Please see notes from developer below:

I think this is something which has to be inquired from Event Espresso. I don’t think that the action which they have supports a complete refresh.
So after logging in using the pop up menu, if you simply refresh the page, you will see that you are not only logged in but also the button is gone.
more over it also fills in the data.

This is the snippet of code which is performing this function, please inquire from Event Espresso that after logging in, two things one the button doesn’t go away and secondly my information stored isn’t filled, how can I do a complete page refresh so that all info is displayed and working as with a page refresh.
function my_add_login_message_button_to_registration() {
if ( ! is_user_logged_in() ) {
$button = ‘‘ . __( ‘Login’, ‘event_espresso’ ) . ‘‘;
echo ‘<p class=”mycustomlogin styleme”>If you already have an account, please login before continuing. ‘ . $button . ‘</p>’;

}
}
add_action( ‘AHEE__attendee_information__reg_step_start’, ‘my_add_login_message_button_to_registration’ );

basically from what I see in the code, it is the action which after being executed use AJAX for logging in and a complete page refresh isn’t been performed. So this is a limitation of the action itself but ideally Event Espresso might have something or might add a complete refresh to this action.

Thank you mate. Just please inquire like this, that I am using the following code on my website:
after the code then inquire these two questions:
Have two small questions:
1) I can still see the login button even after successful login.
2) I can’t see my prefilled data.
Is there any amendments in the code which can make these possible? Thank you.


Jarred

May 31, 2018 at 5:21 pm

this is the code from above post

function my_add_login_message_button_to_registration() {
 if ( ! is_user_logged_in() ) {
  $button = '<a class="ee-roundish ee-orange ee-button float-right ee-wpuser-login-button" href="http://www.artsyrose.com/newsite/login/">' . __( 'Login', 'event_espresso' ) . '</a>';
  echo '<p class="mycustomlogin styleme">If you already have an account, please login before continuing. ' . $button . '</p>';
 
 }
}
add_action( 'AHEE__attendee_information__reg_step_start', 'my_add_login_message_button_to_registration' );


Jarred

May 31, 2018 at 5:27 pm

Okay to omit any confusion, please just see below. I didn’t mean to include my chat.

Here is straight and to the point.

I am using the following code on my website:

function my_add_login_message_button_to_registration() {
 if ( ! is_user_logged_in() ) {
  $button = '<a class="ee-roundish ee-orange ee-button float-right ee-wpuser-login-button" href="http://www.artsyrose.com/newsite/login/">' . __( 'Login', 'event_espresso' ) . '</a>';
  echo '<p class="mycustomlogin styleme">If you already have an account, please login before continuing. ' . $button . '</p>';
 
 }
}
add_action( 'AHEE__attendee_information__reg_step_start', 'my_add_login_message_button_to_registration' );

Have two small questions:
1) I can still see the login button even after successful login.
2) I can’t see my prefilled data.
Is there any amendments in the code which can make these possible? Thank you.


Jarred

June 1, 2018 at 12:51 am

Second Question after your able to answer the one above.

is it possible to do this with WP User Integration

1) Add event to cart
2) MER Popup appears with options
3) Click Proceed to registrations http://prntscr.com/jpdfqo
4) After clicking Proceed to registrations they Land on a page to Login OR Checkout as Guest>
5a) If they login, they are then redirected to the checkout page with the events they added to the cart already with their user info pre-populated
5b) If they click a button that says “Checkout As Guest” they are also redirected to the registration form (checkoutpage) and then they enter all their own info and because we have WP User Integration the info is automatically created so that the next time they add an event to the cart and repeat all the steps above, they will obviously login becuase they had already created an account


Tony

  • Support Staff

June 1, 2018 at 2:26 am

Okay to omit any confusion, please just see below. I didn’t mean to include my chat.

Here is straight and to the point.

Your first post actually makes more sense here as it has some context of what is actually happening, the bullet points don’t explain anything.

More information is better 🙂

1) I can still see the login button even after successful login.
2) I can’t see my prefilled data.

Have you set the event to require login for registrations? I’ve just tested the code you posted and I do see the text on the login step – http://take.ms/5HW9P

If I then log in, I don’t see the text and my information is prefilled – http://take.ms/k7LN1C

So we need more information on the setup, can you link us to the event so we can see the page?

Second Question after your able to answer the one above.

is it possible to do this with WP User Integration

We don’t have that functionality built into Event Espresso in the way you are requesting, so no, not without heavily customizing both the Multi event registration add-on and also the single page checkout process used by EE.

However if you don’t set the event to require login to register the user can checkout as a guest, you can then create a user account for all registrations on the event…. if the user returns and tries to register onto another event (or even the same event) after having an account created, EE will not allow the registration to go through unless they log in (if they use the same details as last time).


Jarred

June 1, 2018 at 1:52 pm

It’s on a staging site, our live website doesn’t have it yet but when we move over the staging site design it will have it. I can give you access privately if needed.

Here is a screenshot.
We have the WP User Integ. set to “NO”

So customer adds event to cart, then the MER popup appears, then they customer proceeds to registration checkout.

Then we have a login popup button on the checkout page.
http://prntscr.com/jpo6cz

So, the customers who already have an account will click the “LOGIN” button and login, BUT when testing this, after we login with our fake user account, this is what happens.

1) we see a notification box saying “Thanks for logging IN”
2) However, none of the pre-filled data is inserted, not even the email address or first name
3) When we click the “LOGIN” button again, its still just a blank form, it doesn’t show the user that they already logged in.

Here is a screenshot of what the login form looks like EVEN AFTER, we have logged in the test user.
http://prntscr.com/jpo8eb

And here is a screenshot of what the registration form looks like EVEN AFTER we have logged in the test user.
http://prntscr.com/jpo8ud

As you can see, even tho we logged in test user, nothing is being filled in,

If you would like access to test site please let me know, I do already have a priority ticket that Josh is currently working on for the Mobile App system and he has ftp access and a username and password for wp admin.

That same info will work for our test site which is in a folder

example.com/newsite/ is the folder the staging site is on

Please let me know if working on it so that I can ask developer and myself not to make any edits to EE, WP user integration or anything else while you trying to fix.


Josh

  • Support Staff

June 1, 2018 at 4:18 pm

Hi Jarred,

This may be an opportunity for the developer to get on the right track. Specifically this code needs to be changed:

$button = '<a class="ee-roundish ee-orange ee-button float-right ee-wpuser-login-button" href="http://www.artsyrose.com/newsite/login/">' . __( 'Login', 'event_espresso' ) . '</a>';

The above code can be improved to use native WP functions and filters and will likely solve the issue you’re having.

A suggested change:

$button = '<a class="ee-roundish ee-orange ee-button float-right ee-wpuser-login-button" href="esc_url( wp_login_url( get_permalink() ) )" alt="esc_attr_e( 'Login', 'textdomain' )">' . __( 'Login', 'textdomain' ) . '</a>';

Then add this additional filter function & callback to change the log in URL:

add_filter( 'login_url', 'jarreds_custom_login_url', 10, 3 );
function jarreds_custom_login_url( $login_url, $redirect, $force_reauth ){
    
    $login_url = site_url( '/login/', 'login' );
    if ( ! empty( $redirect ) ) {
        $login_url = add_query_arg( 'redirect_to', urlencode( $redirect ), $login_url );
    }
    if ( $force_reauth ) {
        $login_url = add_query_arg( 'reauth', '1', $login_url );
    }
    return $login_url;
}
Viewing 10 reply threads

The support post ‘WP User Integration Help Filter Hooks’ 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