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.

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

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.

Looking for a skilled WordPress/WooCommerce developer? I'm currently available for freelance, contract, or full-time remote opportunities! Let's create something amazing together. Send me a quick message, and I'll respond within 24 hours!

Recent Posts

  1. The Ultimate Guide to Indexing in Database Design
  2. Understanding 'update_meta_cache' in WordPress - When to Use It, When Not to, and Its Impact on Database Queries
  3. A Guide to Configuring JavaScript and SCSS Paths in WordPress Plugins with @wordpress/scripts
  4. Disabling Payment Methods in WooCommerce Based on Conditions
  5. How to Update Product Quantity in WooCommerce Using Custom Code

Your Questions / Comments

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