I was wondering if anyone could tell me how I can change the Company field on the Create Account page to be required, I can't seem to find how to do it in the admin panel.... thanks!
I was wondering if anyone could tell me how I can change the Company field on the Create Account page to be required, I can't seem to find how to do it in the admin panel.... thanks!
includes/modules/YOURTEMPLATE/create_account.php
line 40 contains:change that one line to these several lines:PHP Code:
if (ACCOUNT_COMPANY == 'true') $company = zen_db_prepare_input($_POST['company']);
And add a definition for your error message to yourPHP Code:
if (ACCOUNT_COMPANY == 'true') {
$company = zen_db_prepare_input($_POST['company']);
if (strlen($company) < 4) {
$error = true;
$messageStack->add('create_account', ENTRY_COMPANY_NAME_ERROR);
}
}
includes/languages/YOURTEMPLATE/english.php :
PHP Code:
define('ENTRY_COMPANY_NAME_ERROR', 'Please enter a company name.');
Note: the example test above checks that the company name entered is at least 4 characters long.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Ok, thank you very much that worked great. Now, this may seem ridiculous, but I can NOT figure out how to get the red "Required field" asterisk to appear next to company name. Any hints? Thanks again!
That's in the includes/languages/YOURTEMPLATE/english.php
Just add a * or whatever you want in the quotes.PHP Code:
define('ENTRY_COMPANY_TEXT', '');
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Found it! Thanks very much!
I got the * to show up on the create account form however I edited the code as stated in my : /includes/modules/create_account.php file but it does not do anything when company field is left blank.
I did not have a creat_account.php file in my /includes/modules/classic foler.
Do I need to do anything to: templates/template_default/templates/tpl_modules_create_account.php ?
Is there anything I can do to correct this?
I tried to make the company field required, but it doesnt require the company field. Is this snipit good for zen 1.30?
Not getting error or anything, works like default.
I do have the * showing next to the field, but thats about it.
how can i make the address field optional? As i wont really be needing there address info..i want customers to make it a option to enter in there address.
I know this is an old thread, but thanks DrByte, your solution was perfect.
Bookmarks