Post by murray » Thu Dec 09, 2010 6:27 am

Hi,

This is one of those things which should be really easy if you knew exactly what you were doing, but I don't!

I want to make the telephone field on the contact form not required, how can I do this?

Thanks for any help.

New member

Posts

Joined
Wed Sep 30, 2009 8:24 pm

Post by JAY6390 » Thu Dec 09, 2010 9:44 am

Do you mean so you don't have to enter one?

ImageImageImage

SEO MEGA KIT PLUS - Get your site ranking higher in the search engines
Better Product SEO URL's - Perfectly structured product links
SEO URL's Route Editor PRO - Make ANY url on your site have clean keywords - even third party extensions (remove index.php)


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by murray » Thu Dec 09, 2010 7:57 pm

No I want people to be able to add their phone number if they want to but not have it compulsory.

Thanks

New member

Posts

Joined
Wed Sep 30, 2009 8:24 pm

Post by murray » Fri Dec 10, 2010 5:07 pm

Sorry to bump this but can anybody help?

Thanks

New member

Posts

Joined
Wed Sep 30, 2009 8:24 pm

Post by SteveSherry » Sat Dec 11, 2010 8:02 am

Telephone number on the contact form?
My cart doesn't have one.

My Website ¦ Summer Madness Special Offer ¦


Active Member

Posts

Joined
Thu Apr 08, 2010 7:47 am
Location - Wirral, UK

Post by rezter » Sat Dec 11, 2010 12:46 pm

Do you mean when a customer registers an account, you don't want it to be required that they need to give you a telephone number?

If so:

In:

Code: Select all

catalog/view/theme/YOURTHEME/template/account/create.tpl
Find:

Code: Select all

          <tr>
            <td><span class="required">*</span> <?php echo $entry_telephone; ?></td>
            <td><input type="text" name="telephone" value="<?php echo $telephone; ?>" />
              <?php if ($error_telephone) { ?>
              <span class="error"><?php echo $error_telephone; ?></span>
              <?php } ?></td>
          </tr>
Replace with:

Code: Select all

          <tr>
            <td><?php echo $entry_telephone; ?></td>
            <td><input type="text" name="telephone" value="<?php echo $telephone; ?>" /></td>
          </tr>
Then...
In:

Code: Select all

catalog/controller/account/create.php
Find:

Code: Select all

        if (isset($this->error['telephone'])) {
            $this->data['error_telephone'] = $this->error['telephone'];
        } else {
            $this->data['error_telephone'] = '';
        } 
and DELETE it.

Then....
Find:

Code: Select all

        if ((strlen(utf8_decode($this->request->post['telephone'])) < 3) || (strlen(utf8_decode($this->request->post['telephone'])) > 32)) {
              $this->error['telephone'] = $this->language->get('error_telephone');
        } 
and DELETE it.

That should do it.

Newbie

Posts

Joined
Tue Dec 07, 2010 10:09 am

Post by Stije » Sat Mar 12, 2011 5:43 pm

jeuj thanks rezter :) ....i was looking for this :D

Vandaag is mijn Lievelingsdag!

==

Today is my most favorite day!


User avatar
Newbie

Posts

Joined
Fri Dec 31, 2010 4:52 pm
Location - Netherlands

Post by dan74mm » Wed Nov 02, 2011 8:34 pm

Very usefull this topic !

New member

Posts

Joined
Sat Oct 22, 2011 11:08 am

Post by thisisworldwide » Sat Feb 18, 2012 6:10 am

You forgot to do this for the edit account pages and the guest_step_1 checkout pages

basically repeat those steps for those pages. note your coding might not be exact but just search for TELE and you should find what you need.

New member

Posts

Joined
Thu Jun 02, 2011 1:57 am

Post by Nyte_Ryda » Thu Apr 04, 2013 6:55 pm

Hey everyone!

Just thought this might be an easier solution....

http://www.opencart.com/index.php?route ... on_id=6488

It worked for me :D
even though this thread is like 2-3 years old... :laugh:
Someone out there maybe looking for this fix too !!

Regards,

Nyte_Ryda
Running Open Cart v1.5.5.1


Newbie

Posts

Joined
Thu Apr 04, 2013 7:44 am
Location - Australia

Post by loroverde » Wed Sep 04, 2013 11:29 pm

Nyte_Ryda wrote:Hey everyone!

Just thought this might be an easier solution....

http://www.opencart.com/index.php?route ... on_id=6488

It worked for me :D
even though this thread is like 2-3 years old... :laugh:
Someone out there maybe looking for this fix too !!
Also working for me with OpenCart 1.5.6!

Thanks a lot to William Jay!

Newbie

Posts

Joined
Tue Sep 03, 2013 10:49 pm
Who is online

Users browsing this forum: Baidu [Spider] and 43 guests