docs icon indicating copy to clipboard operation
docs copied to clipboard

Wrong service in services.xml - Add Custom Document Type

Open zukucker opened this issue 3 months ago • 0 comments

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 https://github.com/shopware/docs/blob/4199cd1dd957580f31791841aaf8a53dee6a5b41/guides/plugins/plugins/checkout/document/add-custom-document-type.md?plain=1#L347 ?

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>

zukucker avatar Oct 16 '25 11:10 zukucker