PDF generierung onOrder WICHTIG

Hallo zusammen, bin auf der suche nach der lösung eine rechnungspdf einer neuen bestellung automatisiert zu erstellen. Gefunden habe ich diesen netten beispielplugin von shopware: http://wiki.shopware.de/Beispiel-Plugin … _per_eMail Leider funktioniert dieses beispiel bei mir nicht. Habe shopware 4 und folgenden error: PASSED VARIABLE IS NOT AN ARRAY OR OBJECT, USING EMPTY ARRAY INSTEAD IN SHOPWARE/COMPONENTS\DOCUMENT.PHP ON LINE 335 STACK TRACE: #0 Shopware/Components\Document.php(335): ArrayObject-\>\_\_construct(false) #1 Shopware/Components\Document.php(245): Shopware\_Components\_Document-\>loadConfiguration4x() #2 Shopware/Components\Document.php(217): Shopware\_Components\_Document-\>assignValues() #3 Shopware/Plugins\Community\Frontend\Example8\Bootstrap.php(46): Shopware\_Components\_Document-\>render() #4 Enlight\Event\Handler\Plugin.php(149): Shopware\_Plugins\_Frontend\_Example8\_Bootstrap::onOrder(Object(Enlight\_Hook\_HookArgs)) #5 Enlight\Event\EventManager.php(239): Enlight\_Event\_Handler\_Plugin-\>execute(Object(Enlight\_Hook\_HookArgs)) #6 Enlight\Hook\HookManager.php(177): Enlight\_Event\_EventManager-\>filter('sOrder::sSaveOr...', 21075, Object(Enlight\_Hook\_HookArgs)) #7 Shopware/Proxies\sOrderProxy.php(23): Enlight\_Hook\_HookManager-\>executeHooks(Object(Shopware\_Proxies\_sOrderProxy), 'sSaveOrder', Array) #8 Shopware/Controllers\Frontend\Checkout.php(574): Shopware\_Proxies\_sOrderProxy-\>sSaveOrder() #9 Shopware/Controllers\Frontend\Checkout.php(248): Shopware\_Controllers\_Frontend\_Checkout-\>saveOrder() #10 Enlight\Controller\Action.php(135): Shopware\_Controllers\_Frontend\_Checkout-\>finishAction() #11 Enlight\Controller\Dispatcher\Default.php(521): Enlight\_Controller\_Action-\>dispatch('finishAction') #12 Enlight\Controller\Front.php(214): Enlight\_Controller\_Dispatcher\_Default-\>dispatch(Object(Enlight\_Controller\_Request\_RequestHttp), Object(Enlight\_Controller\_Response\_ResponseHttp)) #13 Shopware/Bootstrap.php(79): Enlight\_Controller\_Front-\>dispatch() #14 Enlight\Application.php(192): Shopware\_Bootstrap-\>run() #15 shopware.php(74): Enlight\_Application-\>run() #16 {main} ich hoffe mir kann jemand helfen!

Ok es lag am $typ … im tutorial wird 0 weiter gegeben mit 2 für rechnung funktioniert die erstellung… zu finden im controller backend document.