0

I want to remove newsletter just from checkout page and i search about it and try these codes but i don't get any result.

I add below code in local.xml in app\design\frontend\default\my-theme\layout\local.xml but nothing changed !!!

<checkout_onepage_index>
    <remove name="footer.newsletter"/>
</checkout_onepage_index>

Also i try this code in checkout.xml in app\design\frontend\default\base\default\layout\checkout.xml but again nothing changed !!!

<checkout_onepage_index translate="label">
<remove name="footer.newsletter"/>
</checkout_onepage_index>

thanks for help.

EDIT:

I check my code again when i add below code in checkout.xml, newsletter remove from all pages, why?

<checkout_cart_index translate="label">
    <remove name="footer.newsletter"/>
</checkout_cart_index>

EDIT2: This is the code of local.xml that show newsletter box:

<reference name="footer">
    <remove name="cms_footer_links"/>
    <remove name="footer_links2"/>
    <block type="newsletter/subscribe" name="footer.newsletter" as="footerNewsletter"
           template="newsletter/subscribe-footer.phtml"/>                       
</reference>

EDIT3:

I search this subject again and understand that i should make my directory and copy files that i want to change them, but when i copy checkout.xml and change it to what i want nothing will be happen, because i should change the Current package namein admin panel but if i set my directory for current package name all things will mess!!! I really confused and don't know how can i solve this problem!

Thanks for help.

7
  • Have you checked in your theme where the newsletter is being added? Perhaps not to the footer? May 24, 2015 at 13:06
  • please show the code how you have call footer newletter all pages
    – Amit Bera
    May 24, 2015 at 14:50
  • @TimHallman : How can i check that where the newsletter is being added? I check the newsletter.xml and this is the block in this page: <default> <!-- Mage_Newsletter --> <reference name="left"> <block type="newsletter/subscribe" name="left.newsletter" template="newsletter/subscribe.phtml"/> </reference> </default> Is it added in left? but i test it and nothing chenged.
    – Elham Gdz
    May 25, 2015 at 5:05
  • please show the code by which newsletter has been show to all pages
    – Amit Bera
    May 25, 2015 at 6:26
  • @amitBera : please see my edit2.
    – Elham Gdz
    May 25, 2015 at 6:52

1 Answer 1

2

It would appear that you have it rendering in two places: left.newsletter and footerNewsLetter.

So try

<checkout_cart_index>
        <remove name="footerNewsletter"/>
</checkout_cart_index>

<checkout_cart_index>
        <remove name="left.newsletter"/>
</checkout_cart_index>

local.xml belongs under a theme in your package like so:

app\design\frontend\my-theme\default\layout\local.xml

You also should reference the parent block the newsletter was declared in.

<checkout_cart_index>
    <reference name="footer">
        <remove name="footer.newsletter"/>
    </reference>
</checkout_cart_index>

UPDATE

Magento looks first for files in here app/design/frontend/custom_package/custom_theme/

then it looks for files in here app/design/frontend/custom_package/default

then it looks in here app/design/frontend/base/default

It will also look in the currently configured theme hierarchy for a local.xml

UPDATE

In your local.xml you are giving the block an alias footerNewsletter, you could also use that in your remove statement. Also like Amit says in his more precise answer, you should be using the cart controller in your layout update.

<checkout_cart_index>
    <reference name="footer">
        <remove name="footerNewsletter"/>
    </reference>
</checkout_cart_index>

UPDATE

If you are unsure of how Magento's Theme Hierarchy works, I would suggest reading through the knowledge base article on the subject

You can set your package to be live on the site by going to System -> Configuration -> Design. Then use your custom_package name

11
  • please read my question carefully,your answer is not an answer for my question!!!
    – Elham Gdz
    May 25, 2015 at 6:14
  • I try your answer but it doesn't work !!!
    – Elham Gdz
    May 25, 2015 at 6:23
  • Actually, you had the theme and package name's position switched around. I updated my answer with the correct path. I hope it helps.. May 25, 2015 at 6:25
  • Also FYI declaring a reference around the remove statement won't have any effect
    – Erfan
    May 25, 2015 at 6:27
  • I just have this folders in this path: app\design\frontend\base - default - rwd. which one of these folders do you mean?
    – Elham Gdz
    May 25, 2015 at 6:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.