//
// +------------------------------------------------------------------------------+
// | Hide Telephone During Sign-up 1.0 for Zen Cart    02/25/07 -- econcepts      |
// +-------------------------------------------------------------------------------+
// | Copyright (c) 2007 Enhanced Concepts                                 |
// |                                                                      |
// | Website: http://www.enhancedconcepts.com	                          |
// | Zen Marketing Blog: http://www.enhancedconcepts.com/blog			  |
// | Author: Eric Leuenberger						                      |
// |                                                                      |
// +----------------------------------------------------------------------+
//

-------------------
COMPATIBILTY
-------------------
Compatible with Zen Cart v1.3.x 
http://www.zen-cart.com

-------------------
INTRODUCTION
-------------------
As with the majority of my current and future planned modules for Zen Cart, this module focuses on one feature that, when
used properly, can either increase, or decrease sales conversion of your cart. Experience and testing have shown that
unless absolutely needed, requiring the a user to enter their telephone number during "registration / checkout", will
almost always result in a decrease in conversion (which means lost sales for you, and higher cart abandoment). 

This small yet important module addresses that concern. It gives you greater flexibilty from within the Admin to specify
whether or not you want the user to have to enter their phone number while "registing / checking out". Previously accessing
code was the only way to acheive this (get into the HTML and comment out the un-needed info). Because this item alone
can play a critical role in your sites success, I wanted to make it easy for anybody to acheive this with no need to
access code. Afterall, less "human intervention" means greater chances of success!


-------------------
WHAT THIS MOD DOES
-------------------
This module enables you, from within the Admin, to show or hide the Telephone Number from the "sign-up" (Account Creation) form.

In addtion, you will want to read a few of the "Additional Notes" I have in this file for some examples of the flexibility this
now gives you. This same concept could be acheived in the past by editing code, and setting the Min Value in the Admin to BLANK ( '' ).

I noticed a number of requests in the forums asking "how to make the phone number no required" during sign-up, or hide it all
together. This mod should satisfy that need in an easier way than some users found in the past.


-------------------
FILES TO OVERWRITE
-------------------
(As with any Zen updates, if you are making changes to code for cusomization purposes, it is best to utilize
the overrides system that is in place so your changes do not get overwritten in future updates of Zen.)

NONE (if using a custom template -- RECOMMENDED METHOD) The upload files will be in the following format:
/includes/languages/[YOUR TEMPLATE]/english.php
/includes/modules/[YOUR TEMPLATE]/create_account.php
/includes/templates/[YOUR TEMPLATE]/templates/tpl_modules_create_account.php


3 if using the standard "template_default". If using that, the files that will be overwritten are:
/includes/languages/english.php
/includes/modules/create_account.php
/includes/templates/template_default/templates/tpl_modules_create_account.php

-------------------
DB UPDATES
-------------------
Yes - minor. See installation below. As with all mods, ALWAYS BACKUP your database FIRST before you perform any new additions.
I am not responsible for anything that may happen because someone decided not to backup first.

---------------
INSTALLATION
---------------

1. Rename each directory shown as "YOUR_TEMPLATE" to your template name (that would be 3 directories total).
2. Upload the entire contents of the "includes" folder to your Zen Cart ROOT Folder on your website.
3. Login Admin > Tools > Install SQL Patches and run the following file (install_hidephone.sql to "install it")
4. Go to Admin > Configuration > Customer Details
5. Find the new section called "Telephone Number" (should be right above "Fax Number" in the list) and click it once.
6. Set your desired selection and click "Update"
7. Done!

---------------------
ADDITIONAL NOTES
---------------------

By default, Zen Cart comes with error checking "on" for the telephone field on the "registration form". Intil now,
you could turn this off by logging into the Admin and going to:    Configuration > Minimum Values

From there, all you have to do to make the phone number field not required is to set the value of the "Telephone Number"
to a BLANK (nothing ... no value at all ... as in '') value. That will, by the nature of zen cart, turn "off" the "required
field" feature for the Telehpone field. It will not however "hide it from view" on the sign-up form (which is what this
mod does do for you), nor will it remove the red "asterix" from the form (this is removed by editing a language file).

So, in the past, you could either have the field "required" or not based on what you set the minimum value to within the
Admin. You could not however "hide" the filed from view on the sign-up form without actually editing Zen Cart code.

With this simple mod I have provided, you can now do any combination of the following.
1) Make the telephone number a required field during sign-up and show it.
2) Make the telephone number NOT a required field during sign-up but still show it.
3) Make the telephone number NOT a required field during sign-up and HIDE it totally from view.


Here's how to achieve each of the three above after installing this mod.

1) Make the telephone number a required field during sign-up and show it.
	a) Do nothing. "Out of the box Zen Cart" (default installation) already does this.

2) Make the telephone number NOT a required field during sign-up but still show it.	(this mod must be installed for it to work)
	a) Login to Admin and go to: Configuration > Customer Details
	b) Find "Telephone Number" on the list of options and click it one time to bring up the "Edit Options". Set it to "True" (if
	   not already set).
	c) Next, go to: Configuration > Minimum Values
	d) Set "Telephone Number" option to BLANK (put nothing at all in the mimimum length field, it should be left blank)
	e) You now will want to remove the red "asterix" next to the "Telephone" option on the sign-up form. To do this:
	   Open "/includes/languages/[YOUR TEMPLATE]/english.php" from the enclosed files and find the following line:
		"define('ENTRY_TELEPHONE_NUMBER_TEXT', '*');"
			CHANGE IT TO:
		"define('ENTRY_TELEPHONE_NUMBER_TEXT', '');"
	f) Upload "/includes/languages/[YOUR_TEMPLATE]/english.php" to your website
	g) Done!

3) Make the telephone number NOT a required field during sign-up and HIDE it totally from view. (this mod must be installed for it to work)
	a) Login to Admin and go to: Configuration > Customer Details
	b) Find "Telephone Number" on the list of options and click it one time to bring up the "Edit Options". Set it to "False".
	c) Done!
