Skip to content

Wrong service in services.xml - Add Custom Document Type #1967

@zukucker

Description

@zukucker

Hey,

when creating a custom document type, an incorrect service is specified.
Shouldn't it actually be Swag\BasicExample\Core\Checkout\Document\Render\ExampleDocumentRenderer
instead of

<service id="Shopware\Core\Checkout\Document\Service\PdfRenderer">

?

I find that confusing. It might also be a good idea to include an example of what the whole thing should look like so that you at least get a working template, something like this:

            <service id="Swag\BasicExample\Core\Checkout\Document\Render\ExampleDocumentRenderer ">
                <argument type="service" id="order.repository"/>
                <argument type="service" id="Shopware\Core\Checkout\Document\Service\DocumentConfigLoader"/>
                <argument type="service" id="Shopware\Core\System\NumberRange\ValueGenerator\NumberRangeValueGeneratorInterface"/>
                <argument type="service" id="Shopware\Core\Checkout\Document\Service\DocumentFileRendererRegistry"/>
                <argument>%kernel.project_dir%</argument>
                <tag name="document.renderer" key="pdf"/>
            </service>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions