Zen Cart Logo
Forums / General Questions / New Account Mr. / Ms. Radio Buttons???

New Account Mr. / Ms. Radio Buttons???

Locked

Views: 4,341

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
12 Jan 2008, 4:18 PM
#1
magicman avatar

magicman

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.

12 Jan 2008, 4:20 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: New Account Mr. / Ms. Radio Buttons???

At this time this is a very limited feature ... it will be revamped in a future release ...

12 Jan 2008, 4:57 PM
#3
magicman avatar

magicman

Zen Follower

Join Date:
Oct 2007
Location:
MA, USA
Posts:
385
Plugin Contributions:
0

Re: New Account Mr. / Ms. Radio Buttons???

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.

12 Jan 2008, 5:02 PM
#4
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,611
Plugin Contributions:
0

Re: New Account Mr. / Ms. Radio Buttons???

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.

12 Jan 2008, 5:04 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: New Account Mr. / Ms. Radio Buttons???

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 ...

12 Jan 2008, 5:24 PM
#6
magicman avatar

magicman

Zen Follower

Join Date:
Oct 2007
Location:
MA, USA
Posts:
385
Plugin Contributions:
0

Re: New Account Mr. / Ms. Radio Buttons???

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');

1 Nov 2008, 3:49 PM
#7
coffee_granules avatar

coffee_granules

New Zenner

Join Date:
Nov 2008
Posts:
45
Plugin Contributions:
0

Re: New Account Mr. / Ms. Radio Buttons???

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?

1 Nov 2008, 4:15 PM
#8
coffee_granules avatar

coffee_granules

New Zenner

Join Date:
Nov 2008
Posts:
45
Plugin Contributions:
0

Re: New Account Mr. / Ms. Radio Buttons???

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.

1 Nov 2008, 4:40 PM
#9
coffee_granules avatar

coffee_granules

New Zenner

Join Date:
Nov 2008
Posts:
45
Plugin Contributions:
0

Re: New Account Mr. / Ms. Radio Buttons???

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.

1 Nov 2008, 4:47 PM
#10
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: New Account Mr. / Ms. Radio Buttons???

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

1 Nov 2008, 6:04 PM
#11
coffee_granules avatar

coffee_granules

New Zenner

Join Date:
Nov 2008
Posts:
45
Plugin Contributions:
0

Re: New Account Mr. / Ms. Radio Buttons???

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.!

1 Nov 2008, 6:07 PM
#12
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: New Account Mr. / Ms. Radio Buttons???

just go into admin -> configuration -> customers

and turn OFF the switch for salutation

1 Nov 2008, 6:09 PM
#13
coffee_granules avatar

coffee_granules

New Zenner

Join Date:
Nov 2008
Posts:
45
Plugin Contributions:
0

Re: New Account Mr. / Ms. Radio Buttons???

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!

3 Mar 2010, 1:34 AM
#14
helpmeplease avatar

helpmeplease

New Zenner

Join Date:
Oct 2009
Posts:
30
Plugin Contributions:
0

Re: New Account Mr. / Ms. Radio Buttons???

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.

3 Mar 2010, 5:40 AM
#15
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,703
Plugin Contributions:
56

Re: New Account Mr. / Ms. Radio Buttons???

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).

3 Mar 2010, 5:58 PM
#16
helpmeplease avatar

helpmeplease

New Zenner

Join Date:
Oct 2009
Posts:
30
Plugin Contributions:
0

Re: New Account Mr. / Ms. Radio Buttons???

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: