How to add the newsletter to the header in magento

You can add the newsletter box to the header by putting this in your header.phtml file.

getLayout()->createBlock(‘newsletter/subscribe’)->setTemplate(‘newsletter/subscribe.phtml’)->toHtml(); ?>

In order to style in a different newsletter box you can duplicate the /newsletter folder in the templates folder and change the setTemplate(‘newsletter/subscribe.phtml’)->toHtml(); ?> part to your new folder name – example setTemplate(‘newsletter_SECOND_BOX_FOR_HEADER/subscribe.phtml’)->toHtml(); ?>

Leave a Reply

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