cancel
Showing results for 
Search instead for 
Did you mean: 

Remove telephone required field.

Remove telephone required field.

Hi everybody.

 

I cant seem the remove the required field sign (*) for telephone.

Edited Billing.phtml and still no changes, edited this through :

app/design/frontend/base/default/template/checkout/onepage

 

Also emptied the cache, but it just doesnt change.

 

Im not using the default magento theme, so maybe i need to edit Billing.phtml in another folder. Not sure about this, hope somebody can confirm this.

 

Using mangento 1.9

 

Help would be appreciated.

 

thankyou in advance.

10 REPLIES 10

Re: Remove telephone required field.

typically the file should be in the base/default/template/checkout/onpage as you stated.

but if not, check out  default/YOURTHEME/template/checkout/onepage instead

the code should look simular to::

<div class="field">
<label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
<div class="input-box">
<input type="text" name="billing[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="billing:telephone" />
</div>
</div>


Removing --  class="required"><em>*</em  --    should fix it.   

If not, paste your phone billing code here;

And also, make sure your in the right Onepage folder, if your using a 3rd party one, it wont be in the checkout/onepage folder.

Re: Remove telephone required field.

Thankyou for the advice.

 

But sadley the folder :   default/MYTHEMENAME/template/checkout/onepage

was empty.

 

This is my code for the telephone field (file: base/default/template/checkout/onpage)

as you can see, i removed the <em>*</em> part.  but still no luckk.

 

<div class="field">
<label for="billing:telephone" class="required"><?php echo $this->__('Telephone') ?></label>
<div class="input-box">
<input type="text" name="billing[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="billing:telephone" />

Re: Remove telephone required field.

you also have to remove class = required.

try;

<div class="field">
<label for="billing:telephone"><?php echo $this->__('Telephone') ?></label>
<div class="input-box">
<input type="text" name="billing[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="billing:telephone" />

 
Basically, it should be 100% identical to Fax

except  telephone instead of fax.  

If it doesn't work, paste both your tele and fax code here so I can see

Re: Remove telephone required field.

Didnt work Smiley Sad

here you go, this is my telephone and fax code

 

<li class="fields">
<div class="field">
<label for="billing:telephone"><?php echo $this->__('Telephone') ?></label>
<div class="input-box">
<input type="text" name="billing[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="billing:telephone" />
</div>
</div>
<div class="field">
<label for="billing:fax"><?php echo $this->__('Fax') ?></label>
<div class="input-box">
<input type="text" name="billing[fax]" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('fax') ?>" id="billing:fax" />
</div>
</div>
</li>

Re: Remove telephone required field.

it looks fine to me,

It matches my code I use for my site and it worked for me.

I'm thinking your in the wrong folder.  

The easiest way to know would be to remove the whole field code for telephone and see what happens, if nothing changes. its the wrong file.

What onepage/checkout are you using?

Re: Remove telephone required field.

Are you sure that app/design/frontend/base/default/template/checkout/onepage/billing.phtml is the file being used? There is also app/design/frontend/base/persistent/checkout/onepage/billing.phtml that I belive will be used if persistent shopping cart is configured to be true and possibly the default in latest versions of Magento.

I would turn on template hints to make sure the file you think you should be editing is the correct one:

To turn on template path hints in Magento:

  1. log into the magento back-end admin
  2. Go to System -> Configuration in the main menu
  3. Go to Developer on the bottom left under ADVANCED
  4. Switch to the store view on the top left to your current website or store view.
  5. Under the Debug tab of the same Developer config page you will see a new option appear that will allow you to turn on/off template path hints.

And if that works you should copy that file to your theme and make the edits there.

James Anelay - TheExtensionLab - Simple and efficient Magento extensions that do one thing and do it well. http://www.theextensionlab.com/

Re: Remove telephone required field.

this does not work (using CE 1.9.1) ...

 

the correct template (according to template hints) is: /app/design/frontend/custompackage/[THEME]/template/persistent/checkout/onepage/billing.phtml

 

but removing the

class="required">

in this template file does not solve the problem at all and when clicking next an error states that telephone is still a required field.

 

In German law it is now illegal to require a telephone number at checkout in online shops so this needs to be solved.

Re: Remove telephone required field.

Had the same problem and found, that in Magento 1.9 the following file is used for the checkout-address:

/app/design/frontend/base/default/template/persistent/checkout/onepage/billing.phtml

Re: Remove telephone required field.

Yep, this worked for me! I am using 1.7

 

Now next: try to make also the fields Address, Postal Code, City and Country optional. This is convenient for customers who only purchase a downloadable product. 

 

It works in the same simple way in the same file:

 

<label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>

replace by:

<label for="billing:street1"><?php echo $this->__('Address') ?></label>

 

 <label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>

replace by

<label for="billing:city"><?php echo $this->__('City') ?></label>

 

<label for="billing:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>

replace by

<label for="billing:region_id"><?php echo $this->__('State/Province') ?></label>

 

<label for="billingSmiley Tongueostcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>

replace by

<label for="billingSmiley Tongueostcode"><?php echo $this->__('Zip/Postal Code') ?></label>

 

<label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>

replace by

<label for="billing:country_id" class="required"><?php echo $this->__('Country') ?></label>

 

Well..... there is ONE DOWNSIDE of course:

Customers who buy a physical product that needs to be shipped may not provide the neccessary shipping info.

Bad luck for them or for me when I have to mail them after the order to get the right shipping info

 

Better would be to have this edited file renamed as billing_download_customers.phtml as the same place but referring to it should be an option somewhere else in the website code. Wonder if anybody has a tip on that?