Create an entity_print renderer for orders (to allow order PDF output)

Created on 30 November 2016, over 8 years ago
Updated 15 February 2025, about 2 months ago

We now have an order receipt email rendered from a special commerce-order-receipt twig template.
We can use the same template when generating a PDF of an order.
The PDF generation is done by entity_print. That module allows entity types to define renderers, so we need to define one for commerce_order that renders the twig template and returns it.

Default renderer: http://cgit.drupalcode.org/entity_print/tree/src/Renderer/ContentEntityR...

Feature request
Status

Fixed

Version

2.0

Component

Order

Created by

🇷🇸Serbia bojanz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇯🇵Japan bkenro

    I have a same issue as #92.

    May be worked around with hook_theme_suggestions_HOOK_alter?

    mytheme_theme_suggestions_commerce_order_receipt_alter(&$suggestions, $variables) {
      $buf = $suggestions[1];
      $suggestions[1] = $suggestions[0];
      $suggestions[0] = $buf;
    }
    

    krsort() may be applicable.

Production build 0.71.5 2024