Page 1 of 1

Remove required fields

Posted: Sat Jul 10, 2010 10:08 pm
by pumpui
Hi there,

I´ve searched the forum and google for 2 days now without a real solution for my problem.

I need to remove most of the required fields, needed during a registration.

There are some Post on this and other boards, but No one gives a real solution.
Every time someone ask this question, people say try this or that but no one say , yes it works and tell you how to do it :-[
I´ve also readed the sticky about how to require postcodes,, but i can´t use it reverse because it´s very hard to understand for a not php professional. Would be nice if the support would also be made for usual customers and not only for coders. Also the Documentation don´t give any information about this very important feature.

If someone could point me in the right direction, that would be very great. Or at least give me an official "that is not possible with open cart"

thanks
lara pumpui


PS to some special guys here: Don´t ask why i need this and don´t try to teache me that it is so importent to leave this fields required and bla bla.. i know what i need it for and thats enough!

Re: REMOVE REQUIRED FIELDS

Posted: Sat Jul 10, 2010 10:28 pm
by i2Paq

Re: REMOVE REQUIRED FIELDS

Posted: Sat Jul 10, 2010 10:52 pm
by pumpui
thanks but that is what i was talking about... ::)
That´s no real answers ! just ,,read this or read that,, like i told in my first post LOL.
pumpui wrote:I´ve also readed the sticky about how to require postcodes,, but i can´t use it reverse because it´s very hard to understand for a not php professional.
In this Postcode tutorial he only describes how make a field required,, he say " find this .. and add after this.. "
but did not mentoined in any word how to remove some required fields ;D ;)

but thanks for your try

Re: REMOVE REQUIRED FIELDS

Posted: Sat Jul 10, 2010 11:05 pm
by i2Paq
You could try to think in reverse and see if you can project it on the fields you want to remove...

Re: REMOVE REQUIRED FIELDS

Posted: Sat Jul 10, 2010 11:15 pm
by JAY6390
Like i2Paq has said, you need to basically do the reverse, so say you want to make city NOT required, then you just REMOVE all the lines from those files, ie remove

Code: Select all

if ((strlen(utf8_decode($this->request->post['city'])) < 3) || (strlen(utf8_decode($this->request->post['city'])) > 128)) {
         $this->error['city'] = $this->language->get('error_city');
} 
and

Code: Select all

if (isset($this->error['city'])) {
   $this->data['error_city'] = $this->error['city'];
} else {
   $this->data['error_city'] = '';
} 
You don't really need to remove the language line
in the template you just need to remove

Code: Select all

  <?php if ($error_city) { ?>
  <span class="error"><?php echo $error_city; ?></span>
  <?php } ?></td>
Other than that, not sure really what you need to know

Re: REMOVE REQUIRED FIELDS

Posted: Sat Jul 10, 2010 11:19 pm
by pumpui
thanks so much,

that´s something i can start with

thanks
lara

Re: REMOVE REQUIRED FIELDS

Posted: Sat Jul 24, 2010 7:47 am
by Keith
Hi all, After reading the above posts I am totally confused..I have a very limited grasp of php although I am attempting to learn as much as possible.
I am building a download only site so only require the name & email part of the registration. Would it be possible for one of you 'savvy' gurus to produce a pdf or doc explaining exactly (in laymans terms) which files need editing in order to delete or hide all other requirement fields.
I am prepared to make a donation toward the time spent compiling the info. I am an OS and cubecart convert as I love the 'simplicity' of opencart.

Cheers guys, I am hanging on in anticipation for a simple,reliable method.
P.S. I am using v1.48

Thanks again
Keith

Re: REMOVE REQUIRED FIELDS

Posted: Sat Feb 26, 2011 7:34 pm
by keiron1992
Any update on this please? I have some fields i want to be able to leave blank when submitting the form. Thanks, Keiron :D

Re: Remove required fields

Posted: Sun Feb 02, 2014 5:18 am
by keiron1992