Skip to content

[BUG] Migration 19.x → 20.x payment/info/pdf/ subdirectory required in theme for PDF invoice rendering #5639

Description

@Nestrot

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Problem

When generating invoice PDFs (e.g. via email attachment or admin print),
the following error occurs:

ErrorException: include(...\template\payment/info/pdf/default.phtml): 
Failed to open stream: No such file or directory

Root Cause

Mage_Payment_Block_Info::toPdf() sets the template to payment/info/pdf/default.phtml:

public function toPdf()
{
    $this->setTemplate('payment/info/pdf/default.phtml');
    return $this->toHtml();
}

In Magento 1.x / OpenMage 19.x the template payment/info/default.phtml
was used directly. The pdf/ subdirectory is new in OpenMage 20.x but
no fallback template is provided in base/default.

Workaround

Create the directory and copy the template:
app/design/frontend/[package]/[theme]/template/payment/info/pdf/default.phtml

(Copy from payment/info/default.phtml)

Expected Behavior

Either:

  1. A default template app/design/frontend/base/default/template/payment/info/pdf/default.phtml
    is included in OpenMage 20.x, OR
  2. The migration guide mentions this requirement

Steps To Reproduce

  1. Have a working Magento 1.9.x or OpenMage 19.x installation with a custom theme
  2. Migrate to OpenMage 20.x
  3. Open an order in the backend and create an invoice
  4. Send the invoice by email or print as PDF
  5. Error occurs: include(payment/info/pdf/default.phtml): Failed to open stream: No such file or directory

Environment

- OpenMage: 20.18.0
- PHP: 8.2.12
- Migrated from: Magento 1.8 → OpenMage 20.x

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions