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.

Invisible, uneditable auto-inc fiel

Home Forums Community Forum Invisible, uneditable auto-inc fiel

This topic contains 8 replies, has 4 voices. Last updated by  Cristián Lávaque 4 years, 10 months ago.

Topic Author Topic
Posted: Friday Feb 17th, 2012 at 1:54 am #5457

Hi there,

I would like to create a custom field that will be used to identify our subscribers. We have 500 members who have already been assigned ID numbers. So, I would like to create a custom field that is “businessID”. However, I do not want this to appear on the registration form, or be visible on our members profile. I also want this to be an auto-increment field in the database.

Is this acheiveable?

I thought I could achieve it if there was an option in custom fields for “invisible and uneditable” and then I could set the actual field to auto-increment using phpAdmin. Can you please help me achieve this?

List Of Topic Replies

Viewing 8 replies - 1 through 8 (of 8 total)
Author Replies
Author Replies
Posted: Friday Feb 17th, 2012 at 8:01 pm #5536
Raam Dev
Username: Raam
Staff Member

Hi Joe,

That is not currently possible through the s2Member front-end, however you may be able to modify the Pro-Form template and include your own custom field. You’ll also need to write the necessary custom PHP code to dynamically set the value for this field.

The Pro-Form checkout template can be found at /wp-content/plugins/s2member-pro/includes/templates/forms/paypal-checkout-form.php.

Posted: Friday Feb 17th, 2012 at 10:17 pm #5559

Hi Raam, where do I tell the php code to store the value in the database? Where is the custom field stored in the database and in which table?

Posted: Monday Feb 20th, 2012 at 5:29 pm #5736
Staff Member

This FAQ section might be of some interest here:
Pre Sale FAQs » Is it possible to modify s2Member® Pro Form templates?

where do I tell the php code to store the value in the database? Where is the custom field stored in the database and in which table?

I would suggest using your own custom Meta Field for this.
See: http://codex.wordpress.org/Function_Reference/update_user_meta
http://codex.wordpress.org/Function_Reference/get_user_meta

Posted: Thursday Feb 23rd, 2012 at 1:08 pm #6133

Hey Jason,

Thank you for your response. Would I also create the \”businessID\” field as a S2Member custom profile field? Or, would I just be working directly with the WP custom meta fields?

Also, I am kind of new to hooks/filters – would I be using them to input the meta data at the appropriate time during registration?

It seems to me that when a user registers, I would need to run a query that would search all users and extract the highest \”businessID\”. Then it would increment this by 1 and assign this new value to the user who is registering by assigning a customer meta field to their userID. Is this logic sound? Can you please tell me how I would do this? Which hooks/filters?

Thank you!

Posted: Thursday Feb 23rd, 2012 at 4:14 pm #6175

Hi Jason,

I also wanted to say that I was hoping to utilize the s2member import function b/c we have a list of 400 users with these \”businessID\” numbers assigned.

Ideally I would like to import this list (with the businessID) value using s2member import function (w/ custom profile fields). After doing this, could I insert a function to assign an incremented value to this during the registration of new users?

Posted: Friday Feb 24th, 2012 at 11:24 pm #6380

Hi Joe.

If you want to have each use with a business ID that is unique and auto increments when they register, wouldn’t the user ID in WordPress do the job fine?

Posted: Saturday Feb 25th, 2012 at 1:45 pm #6413

Hey Cristian,

The WordPress userID would, except that we already have about 400 existing users with business IDs assigned.

Posted: Saturday Feb 25th, 2012 at 2:40 pm #6417

I see. Well, if I’m not mistaken, you could go into the database using something like phpMyAdmin and edit their user IDs to be the business ID you already had for them.

Viewing 8 replies - 1 through 8 (of 8 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.