Showing posts with label hacks. Show all posts
Showing posts with label hacks. Show all posts

Wednesday, November 11, 2009

Removing required fields in zen cart user sign up page when they create an account

To remove most of the fields in the 'Create an Account' page, this can be achieved by disabling them one by on in the admin module under the menu:

Configuration->Customer details

One that caught me out was the Mr/Ms field for account gender. Which was strangely Called 'Email Salutation.'

However, there are other stubborn fields such as:

Telephone Number
City
State
Post Code
Street Address
Country (really stubborn)


This is a hack, but it did the job. Basically what I did to get rid of these was:

1. Delete/comment out any code inside the file that is not needed:

'templates/template_default/templates/tpl_modules_create_account.php'

Make sure that the layout of the page is not broken.

2. In the admin module of the shop, click on Configuration->Minimum Values, and set the minimum values for such deleted fields to 0.

3. Then you're left with the stubborn field 'Country'

To get rid of that (hack again), open the file:

'includes/modules/create_account.php'

Roughly around line 225, you will see the following code, which needs to be commented out:

if ( (is_numeric($country) == false) || ($country < 1) ) {
$error = true;
$messageStack->add('create_account', ENTRY_COUNTRY_ERROR);
}


4. Finally, edit the following file, so that the 'Your Account Has Been Created' page doesn't look silly:


'templates/template_default/templates/tpl_create_account_success.php'


I hope this helps!