Magento – Remove telephone required field at checkout

Magento – Remove telephone required field at checkout

In this post we will show you “how to convert required telephone field to Remove telephone required field at checkout in magento “, the Magento checkout prepare obliges clients to enter a telephone number for both charging and transporting addresses.

Remove telephone required field in Magento : On the off chance that your business doesn’t have this prerequisite, we might need to expel this approval from one or both address shapes.

The means underneath will evacuate the telephone prerequisite on the delivery address shape amid checkout. This has been tried with Magento.

Step 1 for Remove telephone required field

The initial step is to change the one page checkout layouts for the address form(s) in which we need to expel the telephone prerequisite. The transportation address shape is situated here:

/app/design/frontend/base/default/template/checkout/onepage/shipping.phtml DO NOT adjust the base format document straightforwardly. Rather, duplicate this document into your site’s own topic and make your alterations there.

Base format records can be overwritten amid Magento updates, so on the off chance that we alter these documents specifically, we’ll presumably free the greater part of your work! Open your duplicate of shipping.phtml and search for the line:


// comment Telephone field 
// for Remove telephone required field


Next, search for the line:



// And supplant it with (remark out reverberate): 
// for Remove telephone required field



That is it. Spare your new format record.

Step 2 for Remove telephone required field

Next, we have to adjust the Magento Customer Address class to remark out some approval code. The code is situated in a unique class, so we can't supersede it.

Rather, we'll make a duplicate of the record in the app/code/local, which Magento will discover and use rather than the center document. Duplicate the document: /app/code/core/Mage/Customer/Model/Address/Abstract.php To:
/app/code/local/Mage/Customer/Model/Address/Abstract.php

NOTE: You'll likely need to make the correct envelope under app/code/local Now, open /app/code/local/Mage/Customer/Model/Address/Abstract.php and on line 375 locate the accompanying code:

if (!Zend_Validate::is($this->getTelephone(), 'NotEmpty')) {
	$errors[] = Mage::helper('customer')- >__('Please enter the telephone number.'); 
} 

// Supplant the above code with (remark out the whole piece): 
// for Remove telephone required field
/* 
// Disable telephone field for approval 
if (!Zend_Validate::is($this->getTelephone(), 'NotEmpty')) { 
	$errors[] = Mage::helper('customer')- >__('Please enter the telephone number.'); 
} 
*/ 

Spare your adjusted Abstract.php record and continue to the following stride.

Step 3 for Remove telephone required field

Some of Magento's field approval rationale is controlled by the arrangement of EAV property estimations, so we'll have to overhaul a couple pushes in the Magento database.

we'll have to make two little alters for Remove telephone required field:

Open the table eav_attribute and scan for the column with attribute_code = "telephone". Make note of the attribute_id of this line. Next, set the segment is_required to 0 (zero).

Presently, open the table customer_eav_attribute and scan for the column with an indistinguishable attribute_id from we noted in the past stride. Set the segment validation_rules on this column to NULL.

Step 4 for Remove telephone required field

At last, we'll have to clear the greater part of Magento's reserves so that your progressions produce results. In the Magento administrator, got to System - > Cache Management, and clear all stores.

Make a point to tap the 'Flush Magento Cache' and 'Flush Cache Storage' catches too. This will constrain Magento to observe your database changes.

conclusion for Remove telephone required field

That is it! When entering another transportation address at checkout, Magento ought to no longer require an incentive for telephone. In the event that we have any proposals for enhancing these means, please leave a remark underneath.

you may also like how to Magento - Making the telephone field not required at checkout

Leave a Comment

Your email address will not be published. Required fields are marked *

73  +    =  81

We accept paid advance and paid guest Posting on our Site : Contact US