/*if (!Zend_Validate::is($this->getTelephone(), 'NotEmpty')) { $errors[] = $helper->__('Please enter telephone.'); }*/
at line 321-323 of app/code/core/mage/customer/model/address/abstract.php
duplicate the file and folder structure in your app/local folders to preserve changes.
Then you need to remove the visual settings..
Edit app/design/frontend/"My Theme"/"My Theme"/template/checkout/onepage/billing.phtml
find these lines and remove <span class="required">*</span> from the telephone section and the required-entry input-text from the class selector as shown above.
You should also make the same changes in app/design/frontend/"My Theme"/"My Theme"/template/customer/address/edit.phtml so that it also works when a registered customer edits their address.
Good luck
Tom.
thanks for the hint.
I did the changes above, but now when I click to send the form, the phone number field is marked as required again.
Did I forgot something to modify (abstract.php, billing.phtml, edit.phtml)?
Is there still no way to make telephone optional using the admin, instead of editing the files? Perhaps in a newer version of magento? I’m still using version 1.1.6.
But you can avoid editing the core files and just edit the phtml theme files. In billing.phtml (above) for example, from the telephone <input...> tag, just remove the “required-entry” class (change class="required-entry input-text” to class="input-text"). Voila! Not required.
But you can avoid editing the core files and just edit the phtml theme files. In billing.phtml (above) for example, from the telephone <input...> tag, just remove the “required-entry” class (change class="required-entry input-text” to class="input-text"). Voila! Not required.
This will absolutely not work.
gotbonsai has given the right way to do it for now (look a few entries up), stick with this solution.
/*if (!Zend_Validate::is($this->getTelephone(), 'NotEmpty')) { $errors[] = $helper->__('Please enter telephone.'); }*/
at line 321-323 of app/code/core/mage/customer/model/address/abstract.php
duplicate the file and folder structure in your app/local folders to preserve changes.
Then you need to remove the visual settings..
Edit app/design/frontend/"My Theme"/"My Theme"/template/checkout/onepage/billing.phtml
find these lines and remove <span class="required">*</span> from the telephone section and the required-entry input-text from the class selector as shown above.
You should also make the same changes in app/design/frontend/"My Theme"/"My Theme"/template/customer/address/edit.phtml so that it also works when a registered customer edits their address.
Good luck
Tom.
I have followed the above and cannot get it to work. I can get it to work if i amend the core code though, which i don’t want to do. Here is what i have done. I have a module called MyModule and have created
and have added all the other changes. But when i click save i still get an alert box asking me to enter a telephone number. So because it is working when i comment it out in the core code and not in my overriding i guess it is an issue with my overridding?
I would like to bring attention to this thread again, as the method described above that consist in commenting some lines on Abstract.php doesn’t work anymore (version 1.3.2.3)
Now this is really annoying. Anyone got this working on the latest version ?
I would like to bring attention to this thread again, as the method described above that consist in commenting some lines on Abstract.php doesn’t work anymore (version 1.3.2.3)
Now this is really annoying. Anyone got this working on the latest version ?
We’re using 1.3.2.3 and its still working with the edit to abstract.php described above at post #3 (except now at lines 346-348). We’ve updated several time since then. It still works.
The core file is unedited, the edited file is in the code/local directory structure.