Guest Posted September 19, 2010 Posted September 19, 2010 Hi How do I insert the red asterisk so as it appears next to the box "Company name", this information is required. Just like it the asterisks appear to the right of the box's "First name", "Last name", etc, on the Create an Account page. Many thanks Grandpa
chadcloman Posted September 19, 2010 Posted September 19, 2010 To add the red asterisk, change the following line in /catalog/includes/languages/english.php: define('ENTRY_COMPANY_TEXT', ''); to be this: define('ENTRY_COMPANY_TEXT', '*'); Note, however that this will only display the asterisk -- it will not make the company name a required field. To do that, modify /catalog/create_account.php so that it checks that the company value exists and is at least ENTRY_COMPANY_MIN_LENGTH characters long. Also modify the error message in /catalog/includes/languages.english.php to be something like this: define('ENTRY_COMPANY_ERROR', 'Your Company must contain a minimum of ' . ENTRY_COMPANY_MIN_LENGTH . ' characters.'); If you are using languages other than English, make the changes to the appropriate <language>.php files (in the same directory as english.php). . Check out Chad's News.
Guest Posted September 20, 2010 Posted September 20, 2010 To add the red asterisk, change the following line in /catalog/includes/languages/english.php: define('ENTRY_COMPANY_TEXT', ''); to be this: define('ENTRY_COMPANY_TEXT', '*'); Note, however that this will only display the asterisk -- it will not make the company name a required field. To do that, modify /catalog/create_account.php so that it checks that the company value exists and is at least ENTRY_COMPANY_MIN_LENGTH characters long. Also modify the error message in /catalog/includes/languages.english.php to be something like this: define('ENTRY_COMPANY_ERROR', 'Your Company must contain a minimum of ' . ENTRY_COMPANY_MIN_LENGTH . ' characters.'); If you are using languages other than English, make the changes to the appropriate <language>.php files (in the same directory as english.php). . Hi Chad Thanks for that all done, except I don't understand what and where " Note, however that this will only display the asterisk -- it will not make the company name a required field. To do that, modify /catalog/create_account.php so that it checks that the company value exists and is at least ENTRY_COMPANY_MIN_LENGTH characters long." This would go. Again many thanks Kind regards John
chadcloman Posted September 20, 2010 Posted September 20, 2010 You will need to change the following files in version 2.2RC2A: address_book_process.php checkout_payment_address.php checkout_shipping_address.php create_account.php admin/customers.php This is one of those things where you need to understand PHP coding. To see how it's done, I suggest finding the code that checks one of the other required fields. Use ENTRY_COMPANY_MIN_LENGTH when doing the check. You may also want to change includes/form_check.js.php so that it checks the Company input. This file is a mix of JavaScript and PHP. . Check out Chad's News.
Guest Posted September 22, 2010 Posted September 22, 2010 You will need to change the following files in version 2.2RC2A: address_book_process.php checkout_payment_address.php checkout_shipping_address.php create_account.php admin/customers.php This is one of those things where you need to understand PHP coding. To see how it's done, I suggest finding the code that checks one of the other required fields. Use ENTRY_COMPANY_MIN_LENGTH when doing the check. You may also want to change includes/form_check.js.php so that it checks the Company input. This file is a mix of JavaScript and PHP. . Hi Chad Thanks for that, will give a go. It's th only way to learn. Many thanks Grandpa
Recommended Posts
Archived
This topic is now archived and is closed to further replies.