Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Code Correction for gender


Genius

Recommended Posts

[/code]HI,

Please could someone assist me with the correct code format for gender... bascally i wanted to add more options rather than Mr & Ms.

 

SO this is what i have ammend in one of my pages:

Codes for referece are

m = male - Mr.

n = femalen - Mrs

f = female - Ms

o = Other - Dr.

 

<?php
 if (ACCOUNT_GENDER == 'true') {
   $male = ($account['customers_gender'] == 'm') ? true : false;
   $femalen = ($account['customers_gender'] == 'n') ? true : false;
   $female = ($account['customers_gender'] == 'f') ? true : false;
   $other = ($account['customers_gender'] == 'o') ? true : false;
?>
         <tr>
           <td class="main"> <?php echo ENTRY_GENDER; ?></td>
           <td class="main"> 
<?php
   if ($is_read_only == true) {
     if ($account['customers_gender'] == 'm') {
     echo MALE;
   } elseif ($account['customers_gender'] == 'n') {
     echo FEMALEN;
   } elseif ($account['customers_gender'] == 'f') {
     echo FEMALE;
   } elseif ($account['customers_gender'] == 'o') {
     echo OTHER;
   }
   } elseif ($error == true) {
     if ($entry_gender_error == true) {
       echo tep_draw_radio_field('gender', 'm', $male) . '  ' . MALE . '  ' . tep_draw_radio_field('gender', 'n', $femalen) . '  ' . FEMALEN . ' '. tep_draw_radio_field('gender', 'f', $female) . '  ' . FEMALE . ' ' . tep_draw_radio_field('gender', 'o', $other) . '  ' . OTHER . ' ' . ENTRY_GENDER_ERROR;
     } else {
     if (($gender == 'm') || ($gender == 'n')|| ($gender == 'f')|| ($gender == 'o')) {
       echo ($gender == 'm') ? MALE : FEMALEN; FEMALE;      } else {
       echo OTHER;     }
       echo tep_draw_hidden_field('gender');
     }
   } else {
     echo tep_draw_radio_field('gender', 'm', $male) . '  ' . MALE . '  ' . tep_draw_radio_field('gender', 'n', $femalen) . '  ' . FEMALEN . ' ' . tep_draw_radio_field('gender', 'f', $female) . '  ' . FEMALE . ' ' . tep_draw_radio_field('gender', 'o', $other) . '  ' . OTHER . ' ' . ENTRY_GENDER_TEXT;
   }

?></td>
         </tr>

 

 

THis part is where i am not sure

      if (($gender == 'm') || ($gender == 'n')|| ($gender == 'f')|| ($gender == 'o')) {
       echo ($gender == 'm') ? MALE : FEMALEN; FEMALE;
     } else {
       echo OTHER;

 

 

is this correct or have i made a mistake... in particulare is the

 

echo ($gender =='m')? MALE : FEMALEN ; FEMALE;

 

is that how it should be or should it be :

 

appeciate you help

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...