latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

How to add custom fields in member profile?

Home Forums Community Forum How to add custom fields in member profile?

This topic contains 5 replies, has 2 voices. Last updated by  Bruce 4 years, 1 month ago.

Topic Author Topic
Posted: Tuesday Dec 4th, 2012 at 6:25 pm #33488

Hi,

I need to add 2 fields within the ‘Edit user’ page, only available to admins.

1) Date of the last payment received (we only take payments via paypal with full integration to s2member)
2) EOT (When is the membership going to expire?)

Can you guide me on how to do this?

Thanks,

  • This topic was modified 4 years, 1 month ago by  Marco Delgado.

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Tuesday Dec 4th, 2012 at 6:55 pm #33497
Bruce
Username: Bruce
Staff Member

Hi Marco,

You can create fields like this in Dashboard -› s2Member® -› General Options -› Registration/Profile Fields by selecting the option No ( uneditable & totally invisible, both during & after registration ) under Allow Profile Edits: *.

Posted: Tuesday Dec 4th, 2012 at 7:48 pm #33502

Hi Bruce,

Yes, I know I can create a field using your method, however, how can I have s2member automatically populate these fields based on the date of the last payment received, which is information provided by paypal.

Posted: Tuesday Dec 4th, 2012 at 8:10 pm #33504
Bruce
Username: Bruce
Staff Member

Hi Marco,

s2Member should automatically fill the EOT date field that is already generated by s2Member as soon as it is available.

EOT date is only available after the user has canceled a subscription, if you are using non-recurring payment styles, or if you have set an EOT date manually.

s2Member keeps track of the last payment recieved automatically. You can get this info using get_user_field('s2member_last_payment_time');. If you’d like more info about a specific user you can use the info provided in this post to get info directly from PayPal.

Posted: Tuesday Dec 4th, 2012 at 9:20 pm #33508

Hi Bruce,

In regards of

get_user_field('s2member_last_payment_time');

Where is this line supposed to go? can’t find the right file.

Posted: Tuesday Dec 4th, 2012 at 9:42 pm #33510
Bruce
Username: Bruce
Staff Member

Where is this line supposed to go? can’t find the right file.

This code should be used in conjunction with a hack to automatically fill a form that you create. I recommend create a Must Use plugin my uploading a .php file to your /wp-content/mu-plugins/ directory (create one if you don’t have one)

You should be able to use get_user_option('s2member_custom_fields'); to get an associative array of custom field values for your user. Then, you can change the value for your field and update_user_option() to change the value.

Viewing 5 replies - 1 through 5 (of 5 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.