Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Non Required Company Field


ocularmagic

Recommended Posts

Posted

I wanted to have our customers be able to add a company name, but if they didn't have a company, not be required to fill in the box. Here are the code snippets in case anyone is interested. If they leave the box blank it puts N/A in the database for their company. I didn't think this qualified as a full contribution so I'll put it here and hopefully people can find it.

 

In catalog/includes/application_top.php and admin/includes/application_top.php make sure you have the company define set to true:

define('ACCOUNT_COMPANY', 'true');

In catalog/includes/languages/english.php around line 181 change from:

define('ENTRY_COMPANY_TEXT', ' <small><font color="#AABBDD">required</font></small>');

To

define('ENTRY_COMPANY_TEXT', ' <small><font color="#AABBDD"></font></small>');

In catalog/create_account_process.php around line 275, right BEFORE:

if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;

Add

if ($company == '') $company = 'N/A';

 

That should do it. If I missed something, don't hesitate to let me know. Hope it helps someone.

If every member of this board donated $1 to the dev team, that would be over $11,000.00. Don't you think this cart is worth at least a $1????

Posted

Thanks for your post, its saved me alot of time if i had to look for it, at sign up it now shows the company field, but.....

 

In admin viewing customer details it does not show company name, do you know how i can enable this.

 

 

regards

tim

Posted

That's odd, it should show up. Did you enable it in admin/includes/application_top.php?

define('ACCOUNT_COMPANY', 'true');

If every member of this board donated $1 to the dev team, that would be over $11,000.00. Don't you think this cart is worth at least a $1????

Archived

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

×
×
  • Create New...