Support

Home Forums Event Espresso Premium Ticket Capability Requirement

Ticket Capability Requirement

Posted: April 27, 2018 at 6:59 am

Viewing 9 reply threads


info@bhaa.ie

April 27, 2018 at 6:59 am

Hi,
We’re using the ‘Ticket Capability Requirement’ feature to ensure that a logged in user can get a discount on their ticket. Our new member registration form is configured to assign the new user to the this role, but in about 10% of cases, we don’t see this happening. This creates a frustration for our users who then don’t see the discount they are entitled to. Is there anything extra we can do to catch these cases?
Regards,
Paul O’Connell

See

http://bhaa.ie/join
http://bhaa.ie/events


Josh

  • Support Staff

April 27, 2018 at 9:02 am

Hi Paul,

You probably would contact the plugin support that does the new user registration and ask for help with troubleshooting this. May I ask what’s the name of the plugin that handles the new user registration?


info@bhaa.ie

April 27, 2018 at 9:11 am

Hi,

It’s the eventexpresso plugin we’re using! Sorry the registration link was incorrect, it should be https://bhaa.ie/events/annual-membership-2018/

Regards,
P


Tony

  • Support Staff

April 27, 2018 at 9:37 am

Hi there,

Just to note, you need to update your SSL certificate, any user using Chrome to view your site will now see this – http://take.ms/Bfe6c

See: https://knowledge.rapidssl.com/support/ssl-certificate-support/index?page=content&id=ALERT2566&actp=LIST&viewlocale=en_US

Our new member registration form is configured to assign the new user to the this role, but in about 10% of cases, we don’t see this happening.

So when this happens, the user account is created and has the subcriber role assigned to it?

Where are you setting the role that should be assigned to the user? Within the event, like this – http://take.ms/ySn8T

If you go to Event Espresso -> Registration form -> User integration settings.

What is the ‘Default role for User Creation on Registration’ option set to there?


info@bhaa.ie

May 2, 2018 at 4:10 am

Hi,

At the global Registration Form > User Integration Settings level, we have the default role set to ‘Subscriber’. The text at this level states ‘On new events, when User creation is set to yes, this setting indicates what the default role for new users will be on creation. You can still override this on each event.’.

On our specific Annual Membership event, I’ve over-written the settings and apply our custom ‘bhaa_member_2018’ role. It seems this custom setting is not always applied.

Thanks for spotting the SSL cert, this was renewed during the week.
Regards,
Paul


Tony

  • Support Staff

May 3, 2018 at 5:16 am

Hmm, that’s strange.

Ok, so starting from the beginning is there any possibility that these users already had a user account (based on the email address) in your WP Users?

EE checks for existing user accounts and exits if it finds one, I know this sounds like a basic question but its really strange to get to the point in the code that adds a user and it does not have the role updated, even more so for ‘some’ registrants to experience this and not others.

If you check one of the accounts this happened to you should see:

Registered via event registration form

within the Bio of the user profile if EE created that user – http://take.ms/53KjS

The user integration add-on has actions fired when either a user is created:

AHEE__EED_WP_Users_SPCO__process_wpuser_for_attendee__user_user_created

or updated:

AHEE__EED_WP_Users_SPCO__process_wpuser_for_attendee__user_user_updated

I can give you some code that runs on both of those hooks, checks the user’s current role and the role set on the event and updates it if needed… but it as mentioned it would be really strange to get to that point without the role being set in the first place so I think there is something else at play here, just no idea what right now.


info@bhaa.ie

May 9, 2018 at 10:31 am

Hey Tony,

I did a quick check with this SQL query

SELECT * FROMwp_usermetaWHEREmeta_key= 'description'

but the field is empty in all cases.

I’ll setup a new plugin with those hooks that you have provided and will add some logging details to track the user status in these cases.


Tony

  • Support Staff

May 9, 2018 at 10:38 am

I did a quick check with this SQL query

SELECT * FROMwp_usermetaWHEREmeta_key= ‘description’

but the field is empty in all cases.

For all users? Or just the users that are having the problem?


info@bhaa.ie

May 9, 2018 at 10:51 am

Tony,

Can you take a look at this github PR

https://github.com/emeraldjava/bhaa_ee_plugin/pull/2

Best Regards,
Paul


Tony

  • Support Staff

May 9, 2018 at 2:43 pm

Hi Paul,

What if, for some reason $user is null and you log null?

I’d log $registration->ID() and the user details.

Also, error_log() accepts a string, $user is likely to be a WP_User object, so that’s not going to work. At the very least it’ll give a PHP Warning each time its passed a WP_User object.

I’d do something like:

if( $registration instanceof EE_Registration ) {
    $debug_info['Registration_ID'] = $registration->ID();
}
if( $user instanceof WP_User ) {
    $debug_info['WP_User'] = array(
        'User_id' => $user->ID,
        'roles' => $user->roles
    );
}
error_log(print_r($debug_info, true));

Writing the full WP_User object to the log will also save the users hashed password, thats up to you if you wish to do so but the above will give you the Registration, User ID and roles the user is assigned to.

Viewing 9 reply threads

The support post ‘Ticket Capability Requirement’ 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