Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

remove some field during new account creation


Recommended Posts

I am also interested in this.

How can I remove Phone Number, or at least make it optional ?

And if PayPal Express don't need them, I want to remove address also (i want to have just Country, and maybe City for statistic purposes).

 

Thank you very much !

Link to comment
Share on other sites

Edit the create_account.php file to remove the fields and validation code for the fields you do not want. In the admin, there are a limited number of fields that can also be turned off, so look for those before editing the create_account.php file.

 

 

Chris

Link to comment
Share on other sites

Edit the create_account.php file to remove the fields and validation code for the fields you do not want. In the admin, there are a limited number of fields that can also be turned off, so look for those before editing the create_account.php file.

 

 

Chris

I disabled what I could from Admin, but I'm getting lost in create_account.php . Can you post an example, about how to disable address, for example?

I hope this will help sunmicrosoft_manis too.

Thank you.

Link to comment
Share on other sites

BACK UP YOUR FILES FIRST !!!!

 

 

In the create_account.php file (standard osc V2.2 RC2a) you would remove this code to delete the address fields:

 

   <tr>
       <td class="main"><b><?php echo CATEGORY_ADDRESS; ?></b></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" cellspacing="2" cellpadding="2">
             <tr>
               <td class="main"><?php echo ENTRY_STREET_ADDRESS; ?></td>
               <td class="main"><?php echo tep_draw_input_field('street_address') . ' ' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></td>
             </tr>
<?php
 if (ACCOUNT_SUBURB == 'true') {
?>
             <tr>
               <td class="main"><?php echo ENTRY_SUBURB; ?></td>
               <td class="main"><?php echo tep_draw_input_field('suburb') . ' ' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></td>
             </tr>
<?php
 }
?>
             <tr>
               <td class="main"><?php echo ENTRY_POST_CODE; ?></td>
               <td class="main"><?php echo tep_draw_input_field('postcode') . ' ' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>
             </tr>
             <tr>
               <td class="main"><?php echo ENTRY_CITY; ?></td>
               <td class="main"><?php echo tep_draw_input_field('city') . ' ' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?></td>
             </tr>
<?php
 if (ACCOUNT_STATE == 'true') {
?>
             <tr>
               <td class="main"><?php echo ENTRY_STATE; ?></td>
               <td class="main">
<?php
   if ($process == true) {
     if ($entry_state_has_zones == true) {
       $zones_array = array();
       $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' order by zone_name");
       while ($zones_values = tep_db_fetch_array($zones_query)) {
         $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
       }
       echo tep_draw_pull_down_menu('state', $zones_array);
     } else {
       echo tep_draw_input_field('state');
     }
   } else {
     echo tep_draw_input_field('state');
   }

   if (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_STATE_TEXT;
?>
               </td>
             </tr>
<?php
 }
?>
             <tr>
               <td class="main"><?php echo ENTRY_COUNTRY; ?></td>
               <td class="main"><?php echo tep_get_country_list('country') . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td class="main"><b><?php echo CATEGORY_CONTACT; ?></b></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" cellspacing="2" cellpadding="2">
             <tr>
               <td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
               <td class="main"><?php echo tep_draw_input_field('telephone') . ' ' . (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></td>
             </tr>
             <tr>
               <td class="main"><?php echo ENTRY_FAX_NUMBER; ?></td>
               <td class="main"><?php echo tep_draw_input_field('fax') . ' ' . (tep_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>

 

Don't forget to also change the minimum requirements to ZERO in the admin for:

 

Street Address

Post Code

City

country

State (if active)

Telephone Number

 

 

Chris

Link to comment
Share on other sites

After making this change, I encountered problems with countries. If I choose some countries from drop-down, the site raises an error, to select a country. Since now this happened only for Spain, I haven't tested for others. But I am afraid that can be more.

 

Do you have any ideas what might be the cause?

Thank you

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...