Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add Magento newsletter in footer? [closed]

I'm novice in Magento. I want to add newsletter option in footer and set newsletter functionality in footer.

like image 231
VIVEK-MDU Avatar asked Dec 10 '12 10:12

VIVEK-MDU


1 Answers

I suppose you speak about the newsletter block to place it in the template. A solution is to create a local.xml layout file in your theme.

For example, your theme is located at /app/design/frontend/default/mytemplate/layout/local.xml

The local.xml has for advantage to allow you to overwrite core layout structure for your own template without the need to copy the whole newsletter.xml layout file of the base template.

Maybe you will need to remove the previous place of the newsletter block. I give you a sample of it below.

In this local.xml file you can do the following:

<?xml version="1.0"?>
<layout version="0.1.0">

<!--
Default layout, loads most of the pages
-->

    <default>
        <remove name="left.newsletter" /> <!-- if you want to remove the newsletter block which is on the left side -->
        <!-- Mage_Newsletter -->
        <reference name="footer">
            <block type="newsletter/subscribe" name="newsletter" as="newsletter" template="newsletter/subscribe.phtml" before="-" />
        </reference>
    </default>
</layout>

Then, in your footer.phtml, you should add the following:

<?php echo $this->getChildHtml('newsletter'); ?>
like image 107
Sylvain Rayé Avatar answered Oct 23 '22 21:10

Sylvain Rayé