Try this,
Note : Don't Edit Core File
It will remove mandatory fields of First Name & Last Name.
UPDATE eav_attribute SET is_required = 0 WHERE attribute_code = 'lastname'
/app/code/local/Mage/customer/Model/Address/Abstract.php:
/* if (!Zend_Validate::is($this->getLastname(), 'NotEmpty')) {
$this->addError(Mage::helper('customer')->__('Please enter the last name.'));
}
*/
/app/code/local/Mage/customer/Model/Customer.php
/* if (!Zend_Validate::is( trim($this->getLastname()) , 'NotEmpty')) {
$errors[] = Mage::helper('customer')->__('The last name cannot be empty.');
}
*/
/app/code/local/Mage/customer/etc/config.xml
<lastname>
<billing>1</billing>
<shipping>1</shipping>
**<required>0</required>** // change from 1 to 0
<mapped>1</mapped>
</lastname>
You can use various local storage mechanisms to store this data in the browser such as Web Storage.
The simplest and most widely supported is WebStorage where you have persistent storage (localStorage) or session based (sessionStorage) which is in memory until you close the browser. Both share the same API.
You can for example (simplified) do something like this when the page is about to reload:
window.onbeforeunload = function() {
localStorage.setItem(name, $('#inputName').val());
localStorage.setItem(email, $('#inputEmail').val());
localStorage.setItem(phone, $('#inputPhone').val());
localStorage.setItem(subject, $('#inputSubject').val());
localStorage.setItem(detail, $('#inputDetail').val());
// ...
}
Web Storage works synchronously so this can work here. Optionally you can store the data for each blur event on the elements where the data is entered.
At page load you can check:
window.onload = function() {
var name = localStorage.getItem(name);
if (name !== null) $('#inputName').val(name);
// ...
}
getItem
returns null
if the data does not exist.
Use sessionStorage
instead of localStorage
if you want to store only temporary.
For More See here.
Best Answer
i am going to assume that this is the default code for magento v.1.9.0.1 and that you are using one page checkout. If so, then you can find the code for this Billing Section in frontend>base>default>template>checkout>onepage>billing.phtml
In that file you will find on line 44-57 the code for email and company fields, you just need to switch the block of code i marked below.
Furthermore, i would not suggest doing it on this file as it is very bad practice to edit magento core file, one option would be to create you own theme, copy this file into it and make the changes there(frontend>mypackage>mytheme>template>checkout>onepage>billing.phtml. I am not going to into the details of magento theming here as its a big topic but you can read this article to get a good idea about theming
http://www.magentocommerce.com/knowledge-base/entry/magentos-theme-hierarchy http://code.tutsplus.com/tutorials/magento-for-designers-part-3--net-11050
P.S you can easily find more article on google