Created
October 20, 2017 15:32
-
-
Save bxtimur/41192c59b91267e08bd2c4b2a12375ae to your computer and use it in GitHub Desktop.
Отправка доп. полей в письме при новом заказе Битрикс
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AddEventHandler("sale", "OnOrderNewSendEmail", "bxModifySaleMails"); | |
function bxModifySaleMails($orderID, &$eventName, &$arFields) { | |
$additional_information = ''; | |
$arOrder = CSaleOrder::GetByID($orderID); | |
$order_props = CSaleOrderPropsValue::GetOrderProps($orderID); | |
while ($arProps = $order_props->Fetch()){ | |
// телефон | |
if ($arProps['ORDER_PROPS_ID'] == 14){ | |
$additional_information.='Телефон: '.$arProps['VALUE'].'<br>'; | |
} | |
if ($arProps['ORDER_PROPS_ID'] == 13){ | |
$additional_information.='<br />E-mail: '.$arProps['VALUE'].'<br>'; | |
} | |
} | |
$arFields["ADDITIONAL_INFORMATION"] = $additional_information; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment