Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
CustomDocRenderer example
'documentType' => 'customDoc',
'documentRangerType' => 'document_example',
'custom' =>
[
'invoiceNumber' => '1100',
]
,
]
;
$this
->
insertCustomDocument
(
)
;
$this
->
insertRange
(
)
;
$registry
=
$this
->
getContainer
(
)
->
get
(
DocumentRendererRegistry::
class
)
;
$customDocGenerator
=
new
CustomDocRenderer
(
)
;
$class
=
new
\
ReflectionClass
(
$registry
)
;
$property
=
$class
->
getProperty
(
'documentRenderers'
)
;
$property
->
setAccessible
(
true
)
;
$oldValue
=
$property
->
getValue
(
$registry
)
;
$property
->
setValue
(
$registry
,
[
$customDocGenerator
]
)
;
$before
=
$this
->
getDocumentId
(
$order
->
getId
(
)
)
;
static
::
assertEmpty
(
$before
)
;