Zen Follower
- Join Date:
- Oct 2007
- Location:
- MA, USA
- Posts:
- 385
- Plugin Contributions:
- 0
New Account Mr. / Ms. Radio Buttons???
How do I add another radio button that says "Mrs."? I have some marries woman that do not use "Ms."
Thanks.
Views: 4,341
Zen Follower
How do I add another radio button that says "Mrs."? I have some marries woman that do not use "Ms."
Thanks.
Oba-san
At this time this is a very limited feature ... it will be revamped in a future release ...
Zen Follower
Where is the file that this code is located? Maybe I can fix it on my own. I know that there are other files that pull this information and are linked but I am willing to give it a shot.
Obaa-san
The problem is the titles are linked to gender at this time. There are only 2 choices. Your best bet it just to turn the filed off via the admin.
Oba-san
You could do a search via the Tools ... Developers Tool Kit ... in the bottom input box for:
gender
and search both the Catalog/Admin and find all references in the files where this is used ...
Zen Follower
Hi Kim,
I see what you mean. I searched through everything and see that they are Gender.
We would need to add a second female gender line to include the Mrs.
Thanks.
Check this out>line 1790:>>includes/modules/payment/paypalwpp.php Is there anything that we could use here to help our cause???
Line #1788 : $gender = '';
Line #1789 : if (urldecode($response['SALUTATION'] == 'Mr')) $gender = 'm';
Line #1790 : if (in_array(urldecode($response['SALUTATION']), array('Ms', 'Mrs'))) $gender = 'f';
Line #1796 : 'payer_gender' => $gender,
Line #2045 : 'customers_gender' => $paypal_ec_payer_info['payer_gender'],
Line #2062 : 'entry_gender' => $paypal_ec_payer_info['payer_gender'],
Line #2505 : $sql_data_array[] = array('fieldName'=>'entry_gender', 'value'=>$address_question_arr['payer_gender'], 'type'=>'enum:m|f');
New Zenner
As far as I can tell there are six files involved with this:
...english/create_account.php
...modules/create_account.php
...languages/english.php
...payment/paypalwpp.php
...admin/customers.php
...admin/email_welcome.php
The problem I am having is configuring the email_welcome.php, where the code shows:
// build the message content
if (ACCOUNT_GENDER == 'true') {
if ($gender == 'm') {
$email_text = sprintf(EMAIL_GREET_MR, $lastname);
} else {
$email_text = sprintf(EMAIL_GREET_MS, $lastname);
}
} else {
$email_text = sprintf(EMAIL_GREET_NONE, $firstname);
I want to change this to to include EMAIL_GREET_MRS and EMAIL_GREET_MISS, but I got an error when I tried adding them as additional else lines, in keeping with the rest of the code.
Could somebody give me some pointers on this, please?
New Zenner
I am also trying to work out the operand arguments for references to m and f.
So far I cannot see where these are defined and can only think that they are first defined when a user creates an account because, until that point, they are not needed (ie: no account, so no emails, no newsletter, etc.).
...modules/checkout_new_address.php
has the following statement
if ( ($gender != 'm') && ($gender != 'f') ) {
so this would need to be changed to something like:
if ( ($gender != 'm') && ($gender != 'f') && ($gender != 'f1') && ($gender != 'f2')) {
and that is why I need to understand more about where the genders are being defined.
I also missed off tpl_modules_create_account.php from the above list - that displays the radio buttons, so needs to be edited too.
New Zenner
I think that the m and f are as defined by the tpl_modules_create_account.php and have added extra radio buttons to my create account form with the following code:
<fieldset>
<legend><?php echo TABLE_HEADING_ADDRESS_DETAILS; ?></legend>
<?php
if (ACCOUNT_GENDER == 'true') {
?>
<?php echo zen_draw_radio_field('gender', 'm', '', 'id="gender-male"') . '<label class="radioButtonLabel" for="gender-male">' . MALE . '</label>' . zen_draw_radio_field('gender', 'f', '', 'id="gender-female"') . '<label class="radioButtonLabel" for="gender-female">' . FEMALE . '</label>' . zen_draw_radio_field('gender', 'f', '', 'id="gender-female"') . '<label class="radioButtonLabel" for="gender-female">' . FEMALE1 . '</label>' . zen_draw_radio_field('gender', 'f', '', 'id="gender-female"') . '<label class="radioButtonLabel" for="gender-female">' . FEMALE2 . '</label>' . (zen_not_null(ENTRY_GENDER_TEXT) ? '<span class="alert">' . ENTRY_GENDER_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
<?php
}
?>
...which is a modification of the existing code and which adds (at the moment FEMALE1 AND FEMALE2 alongside the Mr. and Mrs radio buttons.
So that fixes that, I guess (hope!), but now there is the line in the paypalwpp.php...
I have modified this to read
if (in_array(urldecode($response['SALUTATION']), array('Ms', 'Mrs', 'Miss'))) $gender = 'f';
...but do I need to differentiate (f, f1, f2, etc.) for the Ms, Mrs, and Miss? - I'm thinking not because the original line read read the same, but with no Miss, and no differentiation either.
Totally Zenned
you are beating your head against a wall.....
we tried what your talking about 3 years ago
better to just turn it off,
the devs need to redo this in the future.
hopefully they wil make is so that you can just add what you want in the admin and it outputs a dropdown on the front
New Zenner
Thanks for the update Merlin! - You're a wizard :D
So just turn off new account creation or remove the line from tpl_modules_account_creation.php that references the Mr, Mrs, etc.?
Whichever, for myself I'll add the Mr, Mrs, etc. to the name line and try to disable the emails. - Hopefully the logic statements still work OK so my customers won't get "Dear Mr Mr Smith, etc.!
Totally Zenned
just go into admin -> configuration -> customers
and turn OFF the switch for salutation
New Zenner
Oh, that. - Yeah, that's no problem. - Thought you meant the account creation itself for a moment, which would have been awkward because I was adapting it for order information use!
New Zenner
Kim:
The problem is the titles are linked to gender at this time. There are only 2 choices. Your best bet it just to turn the filed off via the admin.
I have tried turning it off via the amin by making salutation = False....but it still shows up as Mr. and Ms.
What else can I do? I'm ready to cry over this and other things:no::cry:
I'd really appreciate your help.....it just doesn't go away no matter what.
Administrator
Perhaps your template doesn't respect this admin switch? Try temporarily deleting the copy of tpl_modules_create_account.php in your template directory (includes/templates/YOUR TEMPLATE/templates).
New Zenner
swguy:
Perhaps your template doesn't respect this admin switch? Try temporarily deleting the copy of tpl_modules_create_account.php in your template directory (includes/templates/YOUR TEMPLATE/templates).
Oh my gosh swguy! Thank you for pinpointing the file.....I made a copy of the file's code and saved it to a word document on my computer so I can re-paste it back in once we figure out which part of the code is causing my template to not respect the admin switch.
Can you PRETTY PLEASE help me figure out where the problem is in the tpl_modules_create_account.php file so I can put it back in my custom template folder.....I need it in there because I changed something (don't ask me what), and need it in the custom template folder.
I will so so so APPRECIATE :hug: any of your guidance. Ready to scream...again. :shocking:
Tell staff why this post should be reviewed.