magento - Invoice : how do I change the dark grey header to white and the font to black

magento - Invoice : how do I change the dark grey header to white and the font to black

July 31, 2026 · Illustrated author avatarBy Stefan Bogdanescu
magento - Invoice : how do I change the dark grey header to white and the font to black

Customizing Magento Invoice Headers: A Comprehensive Guide

Are you struggling to make your Magento invoices more readable? Many store owners face this issue - the default header color scheme of white text on dark grey background makes it difficult for customers to clearly see their order and invoice numbers.

Identifying the Problem Area

You’re right in looking at app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php. This is where most of the invoice PDF generation logic resides. However, as you’ve noticed, this file doesn’t directly control the header styling.

The header content and style are actually defined within the PDF template files located under app/design/frontend/base/default/template/page/html/head.phtml.

Understanding the Template Structure

Magento uses a layered template structure for generating PDFs:

  1. The parent template (base/default in this case) provides the basic layout.
  2. Child themes can override or extend these templates using their own files.

In your case, you want to modify the head.phtml file to change the header background and text colors.

Changing the Header Color Scheme

To make the necessary changes:

  1. Navigate to the following directory: app/design/frontend/base/default/template/page/html
  2. Locate the head.phtml file.
  3. Open this file in your preferred code editor.

The relevant section for the header is likely located within a <style> block near the top of the file:

<style>
    .page-header {
        background-color: #354670;
        color: white;
        padding: 10px 0;
        text-align: center;
        font-size: 20px;
    }
</style>

To change the header to black text on a white background, update this section as follows:

<style>
    .page-header {
        background-color: #FFFFFF;  // White background
        color: #000000;           // Black text
        padding: 10px 0;
        text-align: center;
        font-size: 20px;
    }
</style>

Testing the Changes

After making these modifications:

  1. Save your changes.
  2. Flush Magento’s cache from the admin panel (System > Cache Management).
  3. Generate a new invoice to test if the header color scheme has been updated successfully.

Remember, as a best practice, it’s often more maintainable to create and modify child theme files rather than directly editing core template files. This allows you to easily update your code without losing changes during Magento upgrades.

For detailed information on creating and managing Magento themes, I recommend checking out our guide on How to Create Your Own Magento Theme.

Conclusion

Changing the header color in Magento invoices is a straightforward process once you understand the template structure. By editing the head.phtml file and modifying the CSS styles within, you can easily switch from a dark grey background to a crisp white one for better readability.

Always remember to flush your cache after making changes and test thoroughly before deploying to a live environment. Happy customizing!

Themes Orders Customers Errors

Our network