Post by CJ! » Thu Oct 11, 2012 7:48 pm

I can't seem to figure out how to change fields from required to not required when registering a new account. I don't want to ask for so much information when they may just want to compare products, add to wishlist or subscribe to a newsletter.I can remove the asterisk by changing the register.tpl in my theme but I can't figure what to alter in the register.php. I am using 1.5.4.1

CJ!
Newbie

Posts

Joined
Mon May 14, 2012 2:12 pm

Post by anung » Fri Oct 12, 2012 12:52 am

Open register.php in catalog/controller/account

make the code under

Code: Select all

private function validate()
be like this.
This for address_1 not requied.

Code: Select all

if ((utf8_strlen($this->request->post['address_1']) < 3) || (utf8_strlen($this->request->post['address_1']) > 128)) {
      		$this->error['address_1'] = $this->language->get('error_address_1');
    	}
make the code be like this

Code: Select all

/*	if ((utf8_strlen($this->request->post['address_1']) < 3) || (utf8_strlen($this->request->post['address_1']) > 128)) {
      		$this->error['address_1'] = $this->language->get('error_address_1');
    	}  */
then open register.tpl in catalog/view/theme/yourtheme/template/account
find this code

Code: Select all

<td><span class="required">*</span> <?php echo $entry_address_1; ?></td>
replace with this code

Code: Select all

<td><?php echo $entry_address_1; ?></td>

User avatar
Active Member

Posts

Joined
Fri Mar 30, 2012 10:32 am
Location - Indonesia

Post by CJ! » Fri Oct 12, 2012 8:03 am

Thank you, that did it. ;D I also had to remove 'required' from another part of my themes register.tpl

Code: Select all

<div class="controls">
								<input type="text" name="firstname" id="firstname" value="<?php echo $firstname; ?>" title="<?php echo $this->language->get('error_firstname'); ?>" class="required span6" required />
								<?php if ($error_firstname) { ?>
								<span class="error"><?php echo $error_firstname; ?></span>
								<?php } ?>
							</div>

CJ!
Newbie

Posts

Joined
Mon May 14, 2012 2:12 pm

Post by Tee15 » Mon Oct 19, 2015 10:06 pm

Hello,

I've been having the same issue and I tried to just delete the code in one area but I must have left a trace somewhere because it didn't work. I looked over this post and began to try this fix but my coding view was a little different so I couldn't perform the same changes. I have vs 1.5.6.4 I suppose that makes a difference.

I am trying to make the Company, Company ID, & Tax ID fields "Not" required. Any suggestions with this?

Any information would be appreciated.

Thanks.

Newbie

Posts

Joined
Sat Jun 13, 2015 12:50 am

Post by uksitebuilder » Mon Oct 19, 2015 10:10 pm

In admin, edit Sale -> Customers -> Customer Groups

Edit your group and you should see option in there for those fields.

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by Tee15 » Mon Oct 19, 2015 11:38 pm

Ok

Thanks I will look in that area to see if I can maneuver the code.

Newbie

Posts

Joined
Sat Jun 13, 2015 12:50 am
Who is online

Users browsing this forum: No registered users and 9 guests