Zen Follower
- Join Date:
- Jul 2011
- Posts:
- 139
- Plugin Contributions:
- 0
How to make customer referral a required field during create account?
I have tried the below updates to make the customers referral a required field. I do have the admin set to 2. The create account page looks correct but it does not actually force the customer to enter text (as in it really is not required)
What I have done so far is:
/includes/languages/YOUR_CUSTOM/english.php
added:
define('ENTRY_CUSTOMERS_REFERRAL_ERROR', 'Please enter who or how you were referred to our site');
define('ENTRY_CUSTOMERS_REFERRAL_TEXT', '*');
/includes/templates/YOUR_CUSTOM/templates/tpl_modules_create_account.php
update to:
//orig line echo zen_draw_input_field('customers_referral', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_referral', '50') . ' id="customers_referral"');
echo zen_draw_input_field('customers_referral', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_referral', '50') . ' id="customers_referral"') . (zen_not_null(ENTRY_CUSTOMERS_REFERRAL_TEXT) ? '<span class="alert">' . ENTRY_CUSTOMERS_REFERRAL_TEXT . '</span>': '');
?>
<br class="clearBoth" />
/includes/modules/YOUR_CUSTOM/create_account.php
**//added below to make referral comment required **
if (strlen($customers_referral) < 4) {
$error = true;
$messageStack->add('create_account', ENTRY_CUSTOMERS_REFERRAL_ERROR);
}
**/includes/modules/pages/create_account/jscript_form_check.php
add: **
check_input("customers_referral", <?php echo ENTRY_CUSTOMERS_REFERRAL; ?>, "<?php echo ENTRY_CUSTOMERS_REFERRAL_ERROR; ?>");
What might I be doing wrong? Thanks