PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Custom Fields Styling

s2Member Plugin. A Membership plugin for WordPress®.

Custom Fields Styling

Postby joadard » December 16th, 2011, 10:42 am

Hello,

I'm trying to locate where the custom fields information is being pulled from - I have a form with custom fields being added and there is a blasted
Code: Select all
<br>
tag in the middle...

Code: Select all
<span>College/University Name *</span>
</label>
<br>
<input


I need to remove it but can't find it anywhere! I've done a search through the files and cannot seem to locate where that might be.

I looked in custom-reg-fields.inc.php - but can't seem to identify how to get this tag to go away!

Thanks in advance :)
User avatar
joadard
Registered User
Registered User
 
Posts: 16
Joined: May 12, 2010

Re: Custom Fields Styling

Postby joadard » December 16th, 2011, 10:44 am

Incidentally - I'm running S2 member pro. I've tried to remove the
Code: Select all
<br />
tags from the file I mentioned in my previous post - but no cigar.
User avatar
joadard
Registered User
Registered User
 
Posts: 16
Joined: May 12, 2010

Re: Custom Fields Styling

Postby Cristián Lávaque » December 17th, 2011, 5:26 am

Hi Jo.

Is that an s2Member Pro pro-form or the default wp-login.php one?
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Custom Fields Styling

Postby joadard » December 17th, 2011, 9:53 am

pro-form - payment checkout form. its when additional fields are added.
User avatar
joadard
Registered User
Registered User
 
Posts: 16
Joined: May 12, 2010

Re: Custom Fields Styling

Postby Cristián Lávaque » December 19th, 2011, 5:18 am

I can't find it in the files either. I'll ask Jason.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Custom Fields Styling

Postby Jason Caldwell » December 19th, 2011, 11:42 am

Check inside one of these files please:

Code: Select all
/s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php
/s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php

Search for: checkbox|pre_checkbox
Or search for: <br />
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Custom Fields Styling

Postby joadard » December 19th, 2011, 9:17 pm

That was it - it was in the PayPal version - THANK YOU!!! Much appreciated. I was pulling my hair out trying to find it! I did a multi-file search for it - it wasn't showing up. I must have been doing something wrong in my search.

Thanks again!
User avatar
joadard
Registered User
Registered User
 
Posts: 16
Joined: May 12, 2010

Re: Custom Fields Styling

Postby TheresaBug » December 20th, 2011, 4:33 pm

I am working with a similar issue regarding the custom fields and the paypal pro form template.

Currently, the custom fields section only shows up for users not logged in. How can I make this section visible to users who are logged in?

I would like to control which custom fields show up under the section heading as well.

Any hints?
User avatar
TheresaBug
Registered User
Registered User
 
Posts: 8
Joined: November 3, 2011

Re: Custom Fields Styling

Postby Raam Dev » December 20th, 2011, 8:51 pm

Hi TheresaBug,

Did you make sure that when you created the Custom Fields, you set Applicable Membership Levels = all and Allow Profile Edits = Yes ( editable )?
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: Custom Fields Styling

Postby TheresaBug » December 21st, 2011, 10:30 am

Thank you, yes those are the settings I have. The fields show up fine on the profile and on the paypal prl form, when not logged in.

For some reason, these "Additional Information" fields do not show up on the paypal pro form if you are logged in. There is a note in the template file saying this intentional

"<!-- Custom Fields will NOT be displayed to existing Users/Members that are already logged-in. s2Member assumes this information has already been collected in that case. -->"

This is what I would like to change. I have a checkbox for acceptance of terms and a phonenumber field, and I would like to make both available to logged in members on the paypal pro form page. I want these fields to be pre-filled with the user's information if they have previously entered it.

Perhaps an easier way to accomplish this is adding these custom fields to the template individually. In that case, what would I put so that these fields are pre-filled?
User avatar
TheresaBug
Registered User
Registered User
 
Posts: 8
Joined: November 3, 2011

Re: Custom Fields Styling

Postby Raam Dev » December 25th, 2011, 10:33 pm

Is it possible to modify the PayPal® and/or Authorize.Net® Pro Form templates?

Usually not necessary. But yes, if you really need to. Please check your /s2member-pro/includes/templates/forms/ directory. You can take the default templates, and place some ( or all of them ) into your own WordPress® theme directory. s2Member Pro will automatically find your custom templates there. By placing custom templates into your theme directory, you can be sure they won't get overwritten in a future upgrade. Either that, or you can just use the default templates like they are, and customize them with your own CSS rules inside the Stylesheet for your WordPress® theme ( i.e. style.css ). If you're using a PriMo Theme ( for instance, the s2Clean Theme ), check your Theme Options Panel, under: Custom CSS / Style Sheet.

* Note. It is also possible to use PHP code in your template files. All WordPress/s2Member framework functionality is available via PHP inside the template files.


So, you can simply take the necessary templates from /s2member-pro/includes/templates/forms/ and copy them into your theme directory. Then you can manually add the custom fields that you always want to show up.

To pre-fill the fields with whatever matches the user's profile, you'll need to first check if the user is logged in (WP Admin -> s2Member -> API/Scripting -> s2Member PHP/API Constants -> S2MEMBER_CURRENT_USER_IS_LOGGED_IN).

Then to set the value for each the fields using the information from the user's profile (WP Admin -> s2Member -> API/Scripting -> s2Member PHP/API Constants -> S2MEMBER_CURRENT_USER_FIELDS).

Does that make sense?
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: Custom Fields Styling

Postby TheresaBug » December 27th, 2011, 12:35 am

I am editing the template, and it is in my theme folder, so I got that far.

Adding the fields seems pretty straightforward as well, however getting the checkbox to pre-fill according to the current user's value is confusing me. What exactly do I type in for the value?

If you could please post the code, that would be very helpful.
User avatar
TheresaBug
Registered User
Registered User
 
Posts: 8
Joined: November 3, 2011

Re: Custom Fields Styling

Postby TheresaBug » December 27th, 2011, 1:22 am

Thank you for pointing me in the right direction, Raam Dev. I think I got it. For anyone looking, here is a tip.

This line has to be present, I threw it in at the top of the template code.
Code: Select all
<?php $fields = json_decode(S2MEMBER_CURRENT_USER_FIELDS, true); ?>


And to get the checkbox to prefill, it needed the if statement. My custom field is called "accept_terms_checkbox"
Code: Select all
<input <?php if (!(strcmp($fields["accept_terms_checkbox"],1))) {echo "checked=\"checked\"";} ?> name="accept_terms_checkbox" type="checkbox" value="accept_terms_checkbox" />


Maybe not the most correct way, if there is a better way, let me know.
User avatar
TheresaBug
Registered User
Registered User
 
Posts: 8
Joined: November 3, 2011

Re: Custom Fields Styling

Postby Eduan » December 27th, 2011, 8:52 am

Looks very good TheresaBug, thanks! :)

I was actually wondering if there was a way to do that. :|

I'll tell you if there's a better way to do this. ;)
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: Custom Fields Styling

Postby Raam Dev » December 27th, 2011, 4:12 pm

TheresaBug,

Thank you for the update and the tip. Glad to hear you got it working! :)
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: Majestic-12 [Bot] and 2 guests

cron