本文整理汇总了PHP中CIBlockElement::GetRealElement方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockElement::GetRealElement方法的具体用法?PHP CIBlockElement::GetRealElement怎么用?PHP CIBlockElement::GetRealElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlockElement
的用法示例。
在下文中一共展示了CIBlockElement::GetRealElement方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: IncludeModuleLangFile
/** @global CUser $USER */
use Bitrix\Main;
use Bitrix\Currency;
if ($USER->CanDoOperation('catalog_read') || $USER->CanDoOperation('catalog_price') || $USER->CanDoOperation('catalog_view')) {
IncludeModuleLangFile($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/catalog/templates/product_edit.php');
$currencyList = array();
foreach (Currency\CurrencyManager::getCurrencyList() as $currency => $currencyName) {
$currencyList[$currency] = array('CURRENCY' => $currency, 'FULL_NAME' => htmlspecialcharsex($currencyName), 'FULL_NAME_JS' => CUtil::JSEscape(htmlspecialcharsbx($currencyName)));
}
unset($currency, $currencyName);
$IBLOCK_ID = (int) $IBLOCK_ID;
if ($IBLOCK_ID <= 0) {
return;
}
$MENU_SECTION_ID = (int) $MENU_SECTION_ID;
$PRODUCT_ID = $ID > 0 ? CIBlockElement::GetRealElement($ID) : 0;
$arBaseProduct = false;
$periodTimeTypes = array();
if ($arMainCatalog['SUBSCRIPTION'] == 'Y') {
$arDefProduct = array('QUANTITY' => '', 'QUANTITY_RESERVED' => '', 'VAT_ID' => 0, 'VAT_INCLUDED' => 'N', 'QUANTITY_TRACE_ORIG' => 'D', 'CAN_BUY_ZERO_ORIG' => 'D', 'PRICE_TYPE' => '', 'RECUR_SCHEME_TYPE' => '', 'RECUR_SCHEME_LENGTH' => '', 'TRIAL_PRICE_ID' => '', 'WITHOUT_ORDER' => '', 'PURCHASING_PRICE' => '', 'PURCHASING_CURRENCY' => '', 'BARCODE_MULTI' => '', 'SUBSCRIBE_ORIG' => 'D');
$periodTimeTypes = CCatalogProduct::GetTimePeriodTypes(true);
} else {
$arDefProduct = array('QUANTITY' => '', 'QUANTITY_RESERVED' => '', 'WEIGHT' => '', 'WIDTH' => '', 'LENGTH' => '', 'HEIGHT' => '', 'MEASURE' => '', 'VAT_ID' => 0, 'VAT_INCLUDED' => 'N', 'QUANTITY_TRACE_ORIG' => 'D', 'CAN_BUY_ZERO_ORIG' => 'D', 'PURCHASING_PRICE' => '', 'PURCHASING_CURRENCY' => '', 'BARCODE_MULTI' => '', 'SUBSCRIBE_ORIG' => 'D');
}
if ($PRODUCT_ID > 0) {
$bReadOnly = !($USER->CanDoOperation('catalog_price') && CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $PRODUCT_ID, "element_edit_price"));
if ($arMainCatalog['SUBSCRIPTION'] == 'Y') {
$arProductSelect = array('ID', 'QUANTITY', 'QUANTITY_RESERVED', 'QUANTITY_TRACE_ORIG', 'VAT_ID', 'VAT_INCLUDED', 'CAN_BUY_ZERO_ORIG', 'PRICE_TYPE', 'RECUR_SCHEME_TYPE', 'RECUR_SCHEME_LENGTH', 'TRIAL_PRICE_ID', 'WITHOUT_ORDER', 'PURCHASING_PRICE', 'PURCHASING_CURRENCY', 'BARCODE_MULTI', 'SUBSCRIBE_ORIG', 'TYPE');
} else {
$arProductSelect = array('ID', 'QUANTITY', 'QUANTITY_RESERVED', 'QUANTITY_TRACE_ORIG', 'WEIGHT', 'WIDTH', 'LENGTH', 'HEIGHT', 'MEASURE', 'VAT_ID', 'VAT_INCLUDED', 'CAN_BUY_ZERO_ORIG', 'PURCHASING_PRICE', 'PURCHASING_CURRENCY', 'BARCODE_MULTI', 'SUBSCRIBE_ORIG', 'TYPE');
}
示例2: IncludeModuleLangFile
<?php
/** @global CUser $USER */
/** @var string $strWarning */
/** @var int $IBLOCK_ID */
/** @var int $ID */
if ($USER->CanDoOperation('catalog_price')) {
$IBLOCK_ID = (int) $IBLOCK_ID;
$ID = (int) $ID;
$userId = (int) $USER->GetID();
if (0 < $IBLOCK_ID && 0 < $ID) {
$PRODUCT_ID = CIBlockElement::GetRealElement($ID);
$bUseStoreControl = COption::GetOptionString('catalog', 'default_use_store_control', 'N') == "Y";
$bEnableReservation = 'N' != COption::GetOptionString('catalog', 'enable_reservation');
if (CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $PRODUCT_ID, "element_edit_price")) {
IncludeModuleLangFile($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/catalog/templates/product_edit_action.php');
if ('' == $strWarning) {
$bUseExtForm = isset($_POST['price_useextform']) && 'Y' == $_POST['price_useextform'];
$arCatalog = CCatalog::GetByID($IBLOCK_ID);
$arCatalogPrice_tmp = array();
$intBasePriceCount = count($arCatalogBasePrices);
$dbCatGroups = CCatalogGroup::GetList(array(), array("!BASE" => "Y"));
while ($arCatGroups = $dbCatGroups->Fetch()) {
unset($arCatalogPrice_tmp);
$arCatalogPrice_tmp = array();
for ($i = 0; $i < $intBasePriceCount; $i++) {
${"CAT_PRICE_" . $arCatGroups["ID"] . "_" . $arCatalogBasePrices[$i]["IND"]} = str_replace(",", ".", ${"CAT_PRICE_" . $arCatGroups["ID"] . "_" . $arCatalogBasePrices[$i]["IND"]});
$arCatalogPrice_tmp[$i] = array("ID" => IntVal(${"CAT_ID_" . $arCatGroups["ID"]}[$arCatalogBasePrices[$i]["IND"]]), "EXTRA_ID" => ${"CAT_EXTRA_" . $arCatGroups["ID"] . "_" . $arCatalogBasePrices[$i]["IND"]} ? IntVal(${"CAT_EXTRA_" . $arCatGroups["ID"] . "_" . $arCatalogBasePrices[$i]["IND"]}) : 0, "PRICE" => ${"CAT_PRICE_" . $arCatGroups["ID"] . "_" . $arCatalogBasePrices[$i]["IND"]}, "CURRENCY" => Trim(${"CAT_CURRENCY_" . $arCatGroups["ID"] . "_" . $arCatalogBasePrices[$i]["IND"]}), "QUANTITY_FROM" => $arCatalogBasePrices[$i]["QUANTITY_FROM"], "QUANTITY_TO" => $arCatalogBasePrices[$i]["QUANTITY_TO"]);
if (strlen($arCatalogPrice_tmp[$i]["CURRENCY"]) <= 0) {
$arCatalogPrice_tmp[$i]["CURRENCY"] = $arCatalogBasePrices[$i]["CURRENCY"];
}
示例3: GetMessage
if ($bVarsFromForm)
CCatalogAdminProductSetEdit::getFormValues($arSets);
CCatalogAdminProductSetEdit::addEmptyValues($arSets);
CCatalogAdminProductSetEdit::showEditForm($arSets);
?></td></tr><?
$tabControl->EndCustomField('PRODUCT_SET', '');
}
if ($arShowTabs['product_group'])
{
$tabControl->BeginNextFormTab();
$tabControl->BeginCustomField('PRODUCT_GROUP', GetMessage('IBLOCK_EL_PRODUCT_GROUP').':', false);
?><tr id="tr_PRODUCT_GROUP"><td colspan="2"><?
$intProductID = (0 < $ID ? CIBlockElement::GetRealElement($ID) : 0);
$arSets = false;
CCatalogAdminProductSetEdit::setProductFormParams(array('TYPE' => CCatalogProductSet::TYPE_GROUP));
if (0 < $intProductID)
{
$arSets = CCatalogProductSet::getAllSetsByProduct($intProductID, CCatalogProductSet::TYPE_GROUP);
if ($bCopy)
CCatalogAdminProductSetEdit::clearOwnerSet($arSets);
}
if (empty($arSets))
$arSets = CCatalogAdminProductSetEdit::getEmptySet($intProductID);
if ($bVarsFromForm)
CCatalogAdminProductSetEdit::getFormValues($arSets);
CCatalogAdminProductSetEdit::addEmptyValues($arSets);
示例4: GetMessage
$arIBlock["SECTIONS_NAME"] = $arIBTYPE["SECTION_NAME"] ? $arIBTYPE["SECTION_NAME"] : GetMessage("IBEL_E_IBLOCK_SECTIONS");
}
ClearVars("str_");
ClearVars("str_prev_");
ClearVars("prn_");
$str_SORT = "500";
if (!$error && $bWorkflow && $view != "Y") {
if (!$bCopy) {
CIBlockElement::WF_Lock($ID);
} else {
CIBlockElement::WF_UnLock($ID);
}
}
if ($historyId <= 0 && $view == "Y") {
$WF_ID = $ID;
$ID = CIBlockElement::GetRealElement($ID);
if ($PREV_ID) {
$prev_result = CIBlockElement::GetByID($PREV_ID);
$prev_arElement = $prev_result->ExtractFields("str_prev_");
if (!$prev_arElement) {
$PREV_ID = 0;
}
}
}
$str_IBLOCK_ELEMENT_SECTION = array();
$str_ACTIVE = $arIBlock["FIELDS"]["ACTIVE"]["DEFAULT_VALUE"] === "N" ? "N" : "Y";
$str_NAME = htmlspecialcharsbx($arIBlock["FIELDS"]["NAME"]["DEFAULT_VALUE"]);
if ($arIBlock["FIELDS"]["ACTIVE_FROM"]["DEFAULT_VALUE"] === "=now") {
$str_ACTIVE_FROM = ConvertTimeStamp(time() + CTimeZone::GetOffset(), "FULL");
} elseif ($arIBlock["FIELDS"]["ACTIVE_FROM"]["DEFAULT_VALUE"] === "=today") {
$str_ACTIVE_FROM = ConvertTimeStamp(time() + CTimeZone::GetOffset(), "SHORT");
示例5: changeTabs
public static function changeTabs($intIBlockID, $intID, &$arCatalog)
{
$result = false;
$intIBlockID = (int) $intIBlockID;
$intID = (int) $intID;
if ($intIBlockID <= 0 || $intID <= 0) {
return $result;
}
if (empty($arCatalog)) {
$arCatalog = CCatalogSKU::GetInfoByIBlock($intIBlockID);
}
if (empty($arCatalog)) {
return $result;
}
if ($arCatalog['CATALOG'] != 'Y') {
return $result;
}
$intProductID = CIBlockElement::GetRealElement($intID);
$boolFeatureSet = CBXFeatures::IsFeatureEnabled('CatCompleteSet');
if ($boolFeatureSet) {
if (isset($_REQUEST['groupdel']) && 'Y' == $_REQUEST['groupdel']) {
$result = CCatalogProductSet::deleteAllSetsByProduct($intProductID, CCatalogProductSet::TYPE_GROUP);
} elseif (isset($_REQUEST['setdel']) && 'Y' == $_REQUEST['setdel']) {
$result = CCatalogProductSet::deleteAllSetsByProduct($intProductID, CCatalogProductSet::TYPE_SET);
}
}
return $result;
}