LearnWebDesignOnline.com is proudly hosted by Hostmonster.com

During new user registration in Zen Cart, sometimes it is ideal to make the address information be optional. This would be the case if you are selling digital goods that does not require a shipping address. And/or if you feel that excessive fields in registration will cause customers to abandon the registration process.
(This tutorial assumes familiarity with PHP, Javascript, and CSS. Tutorial is applicable to ZenCart version 1.3.8).
1. Go to Admin -> Configuration -> Minimum Values and set the appropriate fields to "0".
2. Then you want to remove the asterisks on the account-creation page that indicates a required field. Do this by removing the "*" from the text constants in ...
includes/languages/yourtemplate/english.php
These text constants are used in ...
/includes/templates/yourtemplate/templates/tpl_modules_create_account.php in the alert spans that display the asterisks.
At this point, your customer should be able to register without filling in those field that you have set min values to 0. Later, at checkout process or account management, they will have a chance to edit their empty addresses.
3. Note that if admin tries to update any customer information (such as discount group pricing) via Admin -> Customers -> Customers -> Edit, they will run into additional javascript checks of these normally-required fields. In that case, the admin can fill in values of "unknown" just to make them non-blank in order to perform the save.
If you really need to disable this javascript check in the admin, alter the Javascript check_form() function in admin/customers.php so that it always returns true in order to let the form submit. For example, changing it to ...
function check_form() { return true; }
4. Then there are PHP backend-checks that you need to disable. Do so in /admin/customers.php by commenting out all statements that sets $error = true;. For example, see how we put the two slashes to comment out this statement...
//$error = true;
You also will want to comment out statements with similar error variables. For example...
//$entry_firstname_error = true;
5. Now to remove the display of the red "* required" notation. In /admin/customers.php, add ...
<style type="text/css">
span.fieldRequired {display:none;}
</style>
right before ...
</head>
