# Bestellstatusmail - Adresszusatz

**URL:** <https://forum.shopware.com/t/bestellstatusmail-adresszusatz/31389>\
**Category:** Programmierung\
**Created:** [15. Oktober 2015 um 12:56 UTC](https://forum.shopware.com/t/bestellstatusmail-adresszusatz/31389 "2015-10-15T12:56:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbdus](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/mbdus/32/12997_2.png) [@mbdus](https://forum.shopware.com/u/mbdus)\
**Post date:** [15. Oktober 2015 um 12:56 UTC](https://forum.shopware.com/t/bestellstatusmail-adresszusatz/31389/1 "2015-10-15T12:56:37Z")

</div>

Hallo zusammen, wenn man im Backend den Bestellstatus ändert, popt ein Mail-Fenster auf. In dieser Mail hätte ich auch gerne den Wert des Adresszusatzes. Leider steht diese Variable nicht zur Verfügung. Deshalb wollte ich die Funktion getCustomerInformationByOrderId aus der Datei sOrder überschreiben. Das klappt aber leider nicht. ` $this-\>subscribeEvent ( 'sOrder::getCustomerInformationByOrderId::replace', 'onGetCustomerInformationByOrderId' ); ` ` public function onGetCustomerInformationByOrderId(Enlight\_Event\_EventArgs $args) { $orderId = $args[0]; $sql = " SELECT `b`.`company` AS `billing_company`, `b`.`department` AS `billing_department`, `b`.`salutation` AS `billing_salutation`, `ub`.`customernumber`, `b`.`firstname` AS `billing_firstname`, `b`.`lastname` AS `billing_lastname`, `b`.`street` AS `billing_street`, `b`.`additional_address_line1` AS `billing_additional_address_line1`, `b`.`zipcode` AS `billing_zipcode`, `b`.`city` AS `billing_city`, `b`.`phone` AS `phone`, `b`.`phone` AS `billing_phone`, `b`.`fax` AS `fax`, `b`.`fax` AS `billing_fax`, `b`.`countryID` AS `billing_countryID`, `b`.`stateID` AS `billing_stateID`, `bc`.`countryname` AS `billing_country`, `bc`.`countryiso` AS `billing_countryiso`, `bca`.`name` AS `billing_countryarea`, `bc`.`countryen` AS `billing_countryen`, `b`.`ustid`, `ba`.`text1` AS `billing_text1`, `ba`.`text2` AS `billing_text2`, `ba`.`text3` AS `billing_text3`, `ba`.`text4` AS `billing_text4`, `ba`.`text5` AS `billing_text5`, `ba`.`text6` AS `billing_text6`, `b`.`orderID` as `orderID`, `s`.`company` AS `shipping_company`, `s`.`department` AS `shipping_department`, `s`.`salutation` AS `shipping_salutation`, `s`.`firstname` AS `shipping_firstname`, `s`.`lastname` AS `shipping_lastname`, `s`.`street` AS `shipping_street`, `s`.`additional_address_line1` AS `shipping_additional_address_line1`, `s`.`zipcode` AS `shipping_zipcode`, `s`.`city` AS `shipping_city`, `s`.`stateID` AS `shipping_stateID`, `s`.`countryID` AS `shipping_countryID`, `sc`.`countryname` AS `shipping_country`, `sc`.`countryiso` AS `shipping_countryiso`, `sca`.`name` AS `shipping_countryarea`, `sc`.`countryen` AS `shipping_countryen`, `sa`.`text1` AS `shipping_text1`, `sa`.`text2` AS `shipping_text2`, `sa`.`text3` AS `shipping_text3`, `sa`.`text4` AS `shipping_text4`, `sa`.`text5` AS `shipping_text5`, `sa`.`text6` AS `shipping_text6`, `u`.\*, ub.birthday, `g`.`id` AS `preisgruppe`, `g`.`tax` AS `billing_net` FROM `s_order_billingaddress` as `b` LEFT JOIN `s_order_shippingaddress` as `s` ON `s`.`orderID` = `b`.`orderID` LEFT JOIN `s_user_billingaddress` as `ub` ON `ub`.`userID` = `b`.`userID` LEFT JOIN `s_user` as `u` ON `b`.`userID` = `u`.`id` LEFT JOIN `s_core_countries` as `bc` ON `bc`.`id` = `b`.`countryID` LEFT JOIN `s_core_countries` as `sc` ON `sc`.`id` = `s`.`countryID` LEFT JOIN `s_core_customergroups` as `g` ON `u`.`customergroup` = `g`.`groupkey` LEFT JOIN s\_core\_countries\_areas bca ON bc.areaID = bca.id LEFT JOIN s\_core\_countries\_areas sca ON sc.areaID = sca.id LEFT JOIN s\_order\_billingaddress\_attributes ba ON b.id = ba.billingID LEFT JOIN s\_order\_shippingaddress\_attributes sa ON s.id = sa.shippingID WHERE `b`.`orderID`=? "; $row = Shopware()-\>Db()-\>fetchRow ( $sql, array($orderId)); $args-\>setReturn($row); } ` Leider popt jetzt kein Mailfenster mehr auf. Die Funktion ist puplic. D.h. überschreiben sollte man diese können. Gibt es evtl. einen eleganteren Weg? Kann man auch noch anders die Variable verfügbar machen? Vielen Dank im Voraus! Grüße

---

<div class="post-metadata">

**Author:** ![mbdus](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/mbdus/32/12997_2.png) [@mbdus](https://forum.shopware.com/u/mbdus)\
**Post date:** [15. Oktober 2015 um 13:05 UTC](https://forum.shopware.com/t/bestellstatusmail-adresszusatz/31389/2 "2015-10-15T13:05:46Z")

</div>

Problem gefunden: ` $params = $args-\>getArgs(); $orderId = params[0]; ` Trotzdem sollte man die Variable standardmäßig zur Verfügung stellen. Grüße

---

<div class="post-metadata">

**Author:** ![artep](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@artep](https://forum.shopware.com/u/artep)\
**Post date:** [15. Oktober 2015 um 21:36 UTC](https://forum.shopware.com/t/bestellstatusmail-adresszusatz/31389/3 "2015-10-15T21:36:25Z")

</div>

Ja, das fehlt mir auch und bräuchte ich dringend! Es gibt ein Ticket: [http://jira.shopware.de/?ticket=SW-12784](http://jira.shopware.de/?ticket=SW-12784)
