# extend items in invoice template through hooks / events

**URL:** <https://forum.shopware.com/t/extend-items-in-invoice-template-through-hooks-events/37153>\
**Category:** International (English Only)\
**Tags:** programming\
**Created:** [1. Juni 2016 um 16:31 UTC](https://forum.shopware.com/t/extend-items-in-invoice-template-through-hooks-events/37153 "2016-06-01T16:31:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kaosforge](https://avatars.discourse-cdn.com/v4/letter/k/ee59a6/32.png) [@Kaosforge](https://forum.shopware.com/u/Kaosforge)\
**Post date:** [1. Juni 2016 um 16:31 UTC](https://forum.shopware.com/t/extend-items-in-invoice-template-through-hooks-events/37153/1 "2016-06-01T16:31:22Z")

</div>

I want to add some more attributes to each basket item before creating the invoice PDF through an existing plugin. The plugin uses a hook like onbeforesendmail. Can I use this to extend the basket items which are then displayed in the pdf?

Which sOrders hook / event should I use?

How can I extend the orderitems variable for use in the template with more attributes through the hook?

Through setreturn?

Have to update the $position in the sent mail PDF

---

<div class="post-metadata">

**Author:** ![shyim](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/shyim/32/7681_2.png) [@shyim](https://forum.shopware.com/u/shyim)\
**Post date:** [2. Juni 2016 um 20:14 UTC](https://forum.shopware.com/t/extend-items-in-invoice-template-through-hooks-events/37153/2 "2016-06-02T20:14:36Z")

</div>

The easyist way is a after hook on Shopware\_Components\_Document::assignValues
