define("NEED_AUTH", true);
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
include_once(__DIR__."/init_vars.php");
include(GetLangFileName(__DIR__."/lang/", "/mp3.php"));
$APPLICATION->SetTitle(GetMessage("MP3_BUY_MONEY"));
if (CModule::IncludeModule("sale")):
/////////////////////////////////////////////////////////////////////////////
?>
$errorMessage = "";
if ($_SERVER["REQUEST_METHOD"] == "POST" && $action == "buy" && $USER->IsAuthorized())
{
$PRICE_ID = intval($PRICE_ID);
if ($PRICE_ID <= 0)
$errorMessage .= GetMessage("MP3_ERROR_EMPTY_SUM")."
";
if ($errorMessage == '')
{
if (!array_key_exists($PRICE_ID, $arMP3Sums)
|| array_key_exists($PRICE_ID, $arMP3Sums) && isset($arMP3Sums[$PRICE_ID]["HIDDEN"]) && $arMP3Sums[$PRICE_ID]["HIDDEN"] == "Y")
$errorMessage .= GetMessage("MP3_ERROR_WRONG_SUM")."
";
}
if ($errorMessage == '')
{
$userPrice = DoubleVal($arMP3Sums[$PRICE_ID]["PRICE"]);
$userCurrency = Trim($arMP3Sums[$PRICE_ID]["CURRENCY"]);
$arFields = array(
"PRODUCT_ID" => $PRICE_ID,
"PRICE" => $userPrice,
"CURRENCY" => $userCurrency,
"QUANTITY" => 1,
"LID" => SITE_ID,
"DELAY" => "N",
"CAN_BUY" => "Y",
"NAME" => str_replace("#SUM#", SaleFormatCurrency($userPrice, $userCurrency), GetMessage("MP3_BASKET_NAME")),
"MODULE" => "main",
"PAY_CALLBACK_FUNC" => "MP3DeliveryOrderCallback"
);
$basketID = CSaleBasket::Add($arFields);
if ($basketID)
{
if (CModule::IncludeModule("statistic"))
CStatistic::Set_Event("sale2basket", "main", "");
LocalRedirect("order.php");
}
else
{
if ($ex = $GLOBALS["APPLICATION"]->GetException())
$errorMessage .= $ex->GetString();
else
$errorMessage .= GetMessage("MP3_ERROR_ADD_BASKET")."
";
}
}
}
if ($USER->IsAuthorized())
{
$baseLangCurrency = CSaleLang::GetLangCurrency(SITE_ID);
echo ShowError($errorMessage);
?>
Fatal error: Uncaught Error: Call to undefined function GetMessage() in D:\ktt\ttepla.com\public_html\bitrix\modules\sale\install\sample\mp3\buy_money.php:147
Stack trace:
#0 {main}
thrown in D:\ktt\ttepla.com\public_html\bitrix\modules\sale\install\sample\mp3\buy_money.php on line 147
| |