當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CIBlockElement::GetRealElement方法代碼示例

本文整理匯總了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');
        }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:31,代碼來源:product_edit.php

示例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"];
                        }
開發者ID:Satariall,項目名稱:izurit,代碼行數:31,代碼來源:product_edit_action.php

示例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);
開發者ID:ASDAFF,項目名稱:entask.ru,代碼行數:29,代碼來源:iblock_element_edit.php

示例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");
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:31,代碼來源:iblock_element_edit.php

示例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;
 }
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:28,代碼來源:admin_tools.php


注:本文中的CIBlockElement::GetRealElement方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。