// mail message
if (strlen($arResult["ERROR_MESSAGE"]) <= 0)
{
$event = new CEvent;
$strOrderList = "";
$dbBasketItems = CSaleBasket::GetList(
array("NAME" => "ASC"),
array("ORDER_ID" => $arResult["ORDER_ID"]),
false,
false,
array("ID", "NAME", "QUANTITY")
);
while ($arBasketItems = $dbBasketItems->Fetch())
{
$strOrderList .= $arBasketItems["NAME"]." - ".$arBasketItems["QUANTITY"]." ".GetMessage("SALE_QUANTITY_UNIT");
$strOrderList .= "\n";
}
$arFields = Array(
"ORDER_ID" => $arResult["ORDER_ID"],
"ORDER_DATE" => Date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT", SITE_ID))),
"ORDER_USER" => ( (strlen($arResult["PAYER_NAME"]) > 0) ? $arResult["PAYER_NAME"] : $USER->GetFullName() ),
"PRICE" => SaleFormatCurrency($totalOrderPrice, $arResult["BASE_LANG_CURRENCY"]),
"BCC" => COption::GetOptionString("sale", "order_email", "order@".$SERVER_NAME),
"EMAIL" => $arResult["USER_EMAIL"],
"ORDER_LIST" => $strOrderList,
"SALE_EMAIL" => COption::GetOptionString("sale", "order_email", "order@".$SERVER_NAME)
);
$event->Send("SALE_NEW_ORDER", SITE_ID, $arFields);
}
if (strlen($arResult["ERROR_MESSAGE"]) <= 0)
{
LocalRedirect($arParams["PATH_TO_ORDER"]."?CurrentStep=7&ORDER_ID=".$arResult["ORDER_ID"]);
}
if (strlen($arResult["ERROR_MESSAGE"]) > 0)
$arResult["CurrentStep"] = 5;
}
}
} |