zencart简化客户注册流程
Shops Settings -> customer information in addition to the region choose to keep the drop-down box to select the other in this case switched off, as shown in Figure 1
Two shops Settings -> minimum
Region provinces Company Postcode surname Birthday city phone number here demand is set to No, do not need the option in the edit data Empty submitted can always remember not to enter the digits 0 very important
This set look to the registration page to submit project is not a lot less
But this does not end, we continue to default again later in the following items have a * must be completed. Suggestive of actually indeed must be completed first step first must add projects do not need the same two-step behind the asterisk is removed first;
Going to the * prompt the need to modify the corresponding language pack file
(Tip: Do not use Notepad to edit to modify the PHP file is encoded as UTF8 PHP files reason can look at Baidu on Google BOM information or see Baidu Encyclopedia introduce before)
The file the Zencart code of writing and naming schinese.php example open Chinese language pack to get rid of the Chinese language interface * hint very standardized open schinese.php find something like the following code snippet:
1define ('ENTRY_COMPANY', 'Name:');
2 define ('ENTRY_COMPANY_ERROR', 'Please enter your company name.');
3define ('ENTRY_COMPANY_TEXT', ");
4
5 define ('ENTRY_GENDER', 'Name:');
6 define ('ENTRY_GENDER_ERROR', 'title.');
7 define ('ENTRY_GENDER_TEXT', '*');
The code define ('ENTRY_GENDER_TEXT', '*'); the phrase * deleted careful only to delete * No. remember to keep a half-width of the single quotes is very important!
Other and so remove unwanted items ENTRY_COUNTRY_TEXT *
Save and upload coverage can
May run into a small problem obviously have changed to the right, but why the registration page in the project involves modifying the * prompt still
A: ZenCart file alternative mechanism in the use of alternative file directory and now use the template stored in the same folder of the directory name and file of the same name in the folder, by default, the current template will give priority to load the file using the above to modify the actual language file corresponding path
Should includes / languages / your / language file folder template storage directory name
Instead includes / languages / language file a bit convoluted but you will understand,
So modified, although the required unwanted items behind prompted gone but he will verify that you have submitted the required not fill, so we need to continue to remove the validation checks
The second step remove the required verification
Zencart verification required on the registration form is completed using JS
This JS file is located in the file includes / modules / pages / create_account / under the jscript_form_check.php of
Fortunately, looked a bit Mongolia understand it does not matter there is little skill to view just modified the corresponding fields in the language file and then use this field in which a few lines of code in this field find understand it wants and
But take a comment out code snippets directly deleted relative easy to maintain in the future here is not recommended,
For example: I have just removed the language file detailed address a required prompt his field is ENTRY_STREET_ADDRESS to Which I here ENTRY_STREET_ADDRESS Find
Find such a statement
1 < Php if ((int) ENTRY_STREET_ADDRESS_MIN_LENGTH> 0) { >
2 check_input ("street_address", < Php echo ENTRY_STREET_ADDRESS_MIN_LENGTH; >, "< Php echo ENTRY_STREET_ADDRESS_ERROR; >");
3 < Php} >
We just need the above code snippet commented out to here recommended / * code * / to comment
Here I am finishing the snippet paragraphs generally may not need to comment out as an example
Validation surname
1 / **
2 < Php if ((int) ENTRY_LAST_NAME_MIN_LENGTH> 0) { >
3 check_input ("lastname", < Php echo ENTRY_LAST_NAME_MIN_LENGTH; >, "< Php echo ENTRY_LAST_NAME_ERROR; >");
4 < Php} >
5 * /
Verify Address
1 / **
2 < Php if ((int) ENTRY_STREET_ADDRESS_MIN_LENGTH> 0) { >
3 check_input ("street_address", < Php echo ENTRY_STREET_ADDRESS_MIN_LENGTH; >, "< Php echo ENTRY_STREET_ADDRESS_ERROR; >");
4 < Php} >
5 * /
Verify Zip Code
1 / **
2 < Php if ((int) ENTRY_POSTCODE_MIN_LENGTH> 0) { >
3 check_input ("postcode", < Php echo ENTRY_POSTCODE_MIN_LENGTH; >, "< Php echo ENTRY_POST_CODE_ERROR; >");
4 < Php} > * /
Verify cities
1 / **
2 < Php if ((int) ENTRY_CITY_MIN_LENGTH> 0) { >
3 check_input ("city", < Php echo ENTRY_CITY_MIN_LENGTH; >, "< Php echo ENTRY_CITY_ERROR; >");
4 < Php} >
5 * /
Verify provinces
1 < Php if (ACCOUNT_STATE == 'true') echo 'if (! Form.state.disabled && form.zone_id.value == "") check_input ("state",'. ENTRY_STATE_MIN_LENGTH. ', "'. ENTRY_STATE_ERROR . '")'." n ". 'else if (form.state.disabled) check_select (" zone_id "," ","'. ENTRY_STATE_ERROR_SELECT. '");'." n "; >
Validation National
1 / **
2 check_select ("country", "", "< Php echo ENTRY_COUNTRY_ERROR; >");
3 * /