Support

Home Forums Event Espresso Premium How to get user register based events list?

How to get user register based events list?

Posted: August 9, 2019 at 3:42 am


Dairywomensnetwork

August 9, 2019 at 3:42 am

$events = EE_Registry::instance()->load_model(‘Event’)->get_all();

How to get event list which on user1 have registered?


Dairywomensnetwork

August 9, 2019 at 3:48 am

Fatal error: Class EventEspresso\core\services\collections\Collection contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (ArrayAccess::offsetExists) in \event-espresso-core-reg\core\services\collections\Collection.php on line 19

Also we face this issue on plugin.


Tony

  • Support Staff

August 9, 2019 at 5:44 am

Hi there,

$events = EE_Registry::instance()->load_model(‘Event’)->get_all();

How to get event list which on user1 have registered?

As mentioned multiple times previously, EE support will not simply hand over code snippets to help with customizations. Why? One reason is exactly what is happening here. We give you a snippet for your issue and you move on to the next issue, then request another snippet and another, and another, until we are writing more code than you are for your customizations.

Officially, Event Espresso does not support customizations at all and the answer would simply be to hire a developer that will take the time to understand how to do what you need to do.

However, we (support) have been fairly flexible on this and we’ve given multiple examples for people (including yourself) to work from but again there does come a point when our recommendation will simply be to hire a competent developer.

I’ve linked you to the docs multiple times now, to pull the data you need to pull you need to take the time to understand the model system and how data relates to each other.

You’re using the Event model and users make registrations, registrations are linked to an attendee. So to pull your data your first need the attendee ID, how you get that is up to you as it depends on your use case (the attendee ID is the EE_Contact ID btw).

Then you’d do something like:

$query_args = array(
    0          => array('Registration.ATT_ID' => $att_id),
    'group_by' => 'EVT_ID',
);
$events = EE_Registry::instance()->load_model('Event')->get_all($query_args);

Again, you need to get the ATT_ID for you user for this to work.

If you need further help with this you’ll need to contact a developer, we recommend the folks at codeable.

Fatal error: Class EventEspresso\core\services\collections\Collection contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (ArrayAccess::offsetExists) in \event-espresso-core-reg\core\services\collections\Collection.php on line 19

Which version number of Event Espresso are you running?

Which version of PHP is running on the server?

Have you modified any file within the plugin?

Are you hooking into EE with any customizations?


Dairywomensnetwork

August 9, 2019 at 6:08 am

I am a developer but I can’t find an all options for arguments.
Please clear a code first argument on key is “0”

I have clear I have need events list which logged user has registered.


Tony

  • Support Staff

August 9, 2019 at 6:34 am

Please clear a code first argument on key is “0”

Sorry but I don’t understand this, can you rephrase?

If you are asking what is happening at index 0 of the array then the first element of the array passed to the model system is always an array of ‘where’ conditions for the query, which is explained in the model documentation.

I have clear I have need events list which logged user has registered.

Are you using the WP user integration add-on?

Has the user always registered with details matching their wp user account?

EE doesn’t store the ID of the WP user that created a registration so you can’t just reference the current user.


Dairywomensnetwork

August 9, 2019 at 10:01 am

Tony, Yes we have purchase this plugin, If this one sequre for public i will update my account key?

Just Simple :
1) User ‘x’ registered in 3 events with 2 tickets
2) User ‘y’ registered in 2 events

When x user logged in account there has an idea which event on x has registered.


Tony

  • Support Staff

August 9, 2019 at 10:08 am

Tony, Yes we have purchase this plugin, If this one sequre for public i will update my account key?

I’m sorry but I don’t understand this, update your account key?

I’m asking if you have been using that add-on on the site already?

Just Simple :
1) User ‘x’ registered in 3 events with 2 tickets
2) User ‘y’ registered in 2 events

That’s not as simple as it seems.

Did both of those register onto the events using details that matched their WP User profile data (First Name, Last Name, email) exactly?

When x user logged in account there has an idea which event on x has registered.

It sounds like you want the My Events section of the WP user integration add-on.

https://eventespresso.com/wiki/wp-user-integration/#ee4-my-events

However, it will only show registrations that have been made which matched the user profile data exactly.

Did you fix the PHP fatal error issue?

You must be logged in to reply to this support post. Sign In or Register for an Account

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: publish

Updated by  Tony 1 week, 4 days ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!