Cookie restriction notice in header instead of footer

Cookie restriction notice in header instead of footer

August 28, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Cookie restriction notice in header instead of footer

Solving Cookie Restriction Notice Placement: Header vs Footer

Managing user consent and data privacy preferences is a critical aspect of running an e-commerce platform like Magento. For your web store Jessica Glass Art, you’re facing the common challenge of placing the cookie restriction notice in a more prominent location, specifically in the header area.

Understanding the Default Behavior

By default, the RWD (Responsive Web Design) theme in Magento 1.9 places this notice at the bottom of each page, as dictated by the layout files and template designs. This is a standard configuration aimed at ensuring minimal disruption to the primary content and navigation.

However, for many businesses, including your own, it’s important to make the privacy policy and cookie consent more visible from the start, even before users scroll down to the footer section.

Repositioning the Notice

To achieve this relocation, we’ll need to modify a few key files in your theme. Here’s a step-by-step approach:

  1. Identify the relevant file: In your Magento installation, locate the app/design/frontend/rwd/default/template/page/html/head.phtml file.

  2. Locate the notice code: Within this file, search for the following snippet:

    <?php if ($this->getCanDisplayCookieRestriction()): ?>
        <div id="messages-product-view">
            <?= $this->escapeHtml($this->__('We use cookies to give you the best online experience. If you continue to use this site, that means you accept our cookie policy.')) ?>
        </div>
    <?php endif; ?>
    
  3. Modify the placement: To move this notice to the header, we need to relocate it in your page layout file. Open app/design/frontend/rwd/default/layout/page.xml and find the <reference name="head"> block.

  4. Add the new reference: Within this block (but before the closing tag), add a new reference:

    <block type="core/messages" name="cookie_notice" template="page/html/head.phtml"/>
    
  5. Update your header.phtml: In app/design/frontend/rwd/default/template/page/html/header.phtml, locate the section where you want to display the notice (usually near the top, before the main menu).

  6. Include the new block: Use the getChildHtml function to call this new block:

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

Changing the Notice Image

If you want to update the default image used in the notice, look for the following line in your app/design/frontend/rwd/default/template/page/html/head.phtml file:

<img src="<?php echo $this->getSkinUrl('images/cookie.png'); ?>" alt="<?= $this->escapeHtml($this->__('Cookie Icon')); ?>">

Replace the image URL with the path to your new image, ensuring it’s properly linked within your theme directory.

Compatibility and Testing

This solution should work for Magento 1.9.x versions using the RWD theme. However, always ensure you have a backup of your files before making any modifications.

After updating these files, clear your cache (var/cache directory) and refresh your website to see the relocated notice in action.

Remember, this change is not part of the core Magento functionality, so it’s essential to keep track of these customizations during future Magento updates. It’s also a best practice to use a child theme for such modifications to preserve your changes across theme updates.

For more advanced customizations and themes, consider exploring our services at Laravel Company.

Conclusion

Repositioning the cookie restriction notice from the footer to the header can significantly enhance user awareness of their privacy preferences. By following these steps, you’ll achieve a more visible and user-friendly consent management experience on your Magento-powered online store.

Always ensure you comply with local data protection regulations and provide clear options for users to accept or reject cookies to maintain transparency and build trust in your brand.

Magento 1 Catalog API Themes

Our network