Skip to content

Instantly share code, notes, and snippets.

@bxtimur
Created October 20, 2017 15:32
Show Gist options
  • Save bxtimur/41192c59b91267e08bd2c4b2a12375ae to your computer and use it in GitHub Desktop.
Save bxtimur/41192c59b91267e08bd2c4b2a12375ae to your computer and use it in GitHub Desktop.
Отправка доп. полей в письме при новом заказе Битрикс
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>';
}
// E-mail
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