MODX Community

Custom profile fields advice

On a website I want to sell memberships. I have a Mollie integration where people pay a fee for a year based subscription. The site uses the login extra and the build-in user system.

Now I want to add the payment and membership details in de manager->user page so my client can make sense of payments and membership duration.

So I want a few things:

  1. A extra datefield for storing the start and end-date of the membership
  2. A table for payments that has been made

As far as I see I have a few options:

  1. Use extended userfields -> but I don’t get how the fields are shown in the manager
  2. Use classextender -> Seems challenging

Quite familiar with Modx, but never done such a thing. Hoping for some advice from you guys.

Cheers,
Ilja

The extra “ClassExtender” uses the event OnUserFormRender to output custom fields to the user page (OnUserFormPrerender for CSS or JS). You could do the same, if you don’t want to use the extra and want to read the data from somewhere else.

Thanks. But that’s the visual part of the story. That means I save and retrieve the data myself in the DB.

It’s possible to create Custom Users.

It seems I’m misunderstanding what you really want to achieve.
I though that you maybe want to make some calls to a (Mollie-)API and show the result to the user for information purposes or maybe display data that is stored in the extended-field in a more readable way.

@joshualuckers Thanks, will look into that. Seems complex tho.
@halftrainedharry Thanks. I would like to store some data and make it accessible (editable) in the modx manager->users.

The link that @joshualuckers posted is basically what the extra “ClassExtender” does. This extra isn’t that complicated, if you just use textfields (like in the example it provides).

But in your case, if you want to display and edit a whole table for payments, you will probably need an additional database table and some custom ext.js code for the grid (and the extra “ClassExtender” won’t help you with that).

ClassExtender will create a separate DB table to hold your data, but you may need a custom snippet to handle some of the fields and possibly to control what users can do on your site.

ClassExtender comes with example code to let users modify their data in the custom table, the ([[!ExtUserUpdateProfile]] snippet) but it may have to be altered to meet your needs. You may have to add a datepicker for the date fields and some code to save them if the user is meant to alter them.

Accessing the data in the custom table using a snippet is fairly straightforward and the docs have some examples.

1 Like

Thanks for the comments. I will try Classextender and the Custom user option.