Sarathlal N

Add a mini login form to header – Magento 1

In default, Magento have a mini login form and we can use it any where in our page blocks.

Now I’m going to add this mini login form in our page header with in few simple steps.

First we want to add login form block to header for sign out customers. We can use our theme’s local.xml file for this purpose.

Just add below code snippet to our theme’s local.xml file.

 <reference name="header">
 <block type="customer/form_login" name="header_customer_form_mini_login" template="customer/form/mini.login.phtml"/>

Then call this login form in header section of our template file.

 <?php echo $this->getChildHtml('header_customer_form_mini_login') ?>

This code snippets will display a login form in header section for logged out customers only.

Need Help?

Do you need any help on Magento 1? I'm happy to help you.

Contact Me

Recent Posts

  1. Get variation product data on selecting variation options - WooCommerce
  2. Add TinyMCE WYSIWYG (Rich text area) meta box - WordPress
  3. Reorder product tabs in single product page - WooCommerce
  4. Download webpage for offline reading - wget
  5. Remove product tabs in single product page - WooCommerce

Your Questions / Comments

If you found this article interesting, found errors, or just want to discuss about them, please get in touch.