Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

debug shopware6 document pdf

How do we debug the shopware6 pdf generation? A {{ dump() }} will not work, the pdf is not generated. We get an error then:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0')

Are there any possibilities? Maybe can we get the html instead of pdf to find what we are looking for?

like image 548
Marc Cheng Avatar asked Oct 17 '25 06:10

Marc Cheng


1 Answers

See the OrderDocumentCriteriaFactory for which association of the order are available in the template. If you plan on working with an association, be mindful that they must be added to that criteria and may be nullable as well. Adding a sanity check too many is preferable to assuming all orders will come with every association.

Also see the DocumentTemplateRenderer. If an exception is thrown while rendering the twig template, this is where the exception could be caught for further debugging.

like image 173
dneustadt Avatar answered Oct 20 '25 08:10

dneustadt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!