本文整理汇总了PHP中CCatalogSku::GetInfoByOfferIBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP CCatalogSku::GetInfoByOfferIBlock方法的具体用法?PHP CCatalogSku::GetInfoByOfferIBlock怎么用?PHP CCatalogSku::GetInfoByOfferIBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCatalogSku
的用法示例。
在下文中一共展示了CCatalogSku::GetInfoByOfferIBlock方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTabs
public static function getTabs($iblockElementInfo)
{
$showTab = false;
if ($iblockElementInfo["ID"] > 0) {
$showTab = true;
if (Loader::includeModule('catalog')) {
/*
$dbRes = CatalogIblockTable::getList(array(
'filter' => array(
'=IBLOCK_ID' => $iblockElementInfo["IBLOCK"]["ID"],
'!PRODUCT_IBLOCK_ID' => 0
),
'select' => array('IBLOCK_ID'),
));
if($dbRes->fetch())
{
$showTab = false;
}
*/
if (\CCatalogSku::GetInfoByOfferIBlock($iblockElementInfo["IBLOCK"]["ID"]) !== false) {
$showTab = false;
}
}
}
return $showTab ? array(array("DIV" => "seo_adv", "SORT" => 4, "TAB" => Loc::getMessage("SEO_ADV_TAB"), "TITLE" => Loc::getMessage("SEO_ADV_TAB_TITLE"))) : null;
}
示例2: _GetProductUrl
public static function _GetProductUrl($OF_ELEMENT_ID, $OF_IBLOCK_ID, $server_name = false, $arrType = false)
{
static $arIBlockCache = array();
static $arElementCache = array();
$product_url = "";
$OF_ELEMENT_ID = (int) $OF_ELEMENT_ID;
$OF_IBLOCK_ID = (int) $OF_IBLOCK_ID;
if ($arrType === "E" && $OF_IBLOCK_ID > 0 && $OF_ELEMENT_ID > 0 && Loader::includeModule('catalog')) {
if (!isset($arIBlockCache[$OF_IBLOCK_ID])) {
$arIBlockCache[$OF_IBLOCK_ID] = CCatalogSku::GetInfoByOfferIBlock($OF_IBLOCK_ID);
if (is_array($arIBlockCache[$OF_IBLOCK_ID])) {
$arIBlockCache[$OF_IBLOCK_ID]["PRODUCT_IBLOCK"] = CIBlock::GetArrayByID($arIBlockCache[$OF_IBLOCK_ID]["PRODUCT_IBLOCK_ID"]);
}
}
if (is_array($arIBlockCache[$OF_IBLOCK_ID])) {
if (!array_key_exists($OF_ELEMENT_ID, $arElementCache)) {
$OF_PROP_ID = $arIBlockCache[$OF_IBLOCK_ID]["SKU_PROPERTY_ID"];
$rsOffer = CIBlockElement::GetList(array(), array("IBLOCK_ID" => $arIBlockCache[$OF_IBLOCK_ID]["IBLOCK_ID"], "=ID" => $OF_ELEMENT_ID), false, false, array("LANG_DIR", "PROPERTY_" . $OF_PROP_ID . ".ID", "PROPERTY_" . $OF_PROP_ID . ".CODE", "PROPERTY_" . $OF_PROP_ID . ".XML_ID", "PROPERTY_" . $OF_PROP_ID . ".IBLOCK_ID", "PROPERTY_" . $OF_PROP_ID . ".IBLOCK_SECTION_ID"));
if ($arOffer = $rsOffer->Fetch()) {
$arOffer["PROPERTY_" . $OF_PROP_ID . "_IBLOCK_SECTION_CODE"] = '';
if (intval($arOffer["PROPERTY_" . $OF_PROP_ID . "_IBLOCK_SECTION_ID"]) > 0) {
$rsSections = CIBlockSection::GetByID($arOffer["PROPERTY_" . $OF_PROP_ID . "_IBLOCK_SECTION_ID"]);
if ($arSection = $rsSections->Fetch()) {
$arOffer["PROPERTY_" . $OF_PROP_ID . "_IBLOCK_SECTION_CODE"] = $arSection['CODE'];
}
}
$arElementCache[$OF_ELEMENT_ID] = array("LANG_DIR" => $arOffer["LANG_DIR"], "ID" => $arOffer["PROPERTY_" . $OF_PROP_ID . "_ID"], "ELEMENT_ID" => $arOffer["PROPERTY_" . $OF_PROP_ID . "_ID"], "CODE" => $arOffer["PROPERTY_" . $OF_PROP_ID . "_CODE"], "ELEMENT_CODE" => $arOffer["PROPERTY_" . $OF_PROP_ID . "_CODE"], "EXTERNAL_ID" => $arOffer["PROPERTY_" . $OF_PROP_ID . "_XML_ID"], "IBLOCK_TYPE_ID" => $arIBlockCache[$OF_IBLOCK_ID]["PRODUCT_IBLOCK"]["IBLOCK_TYPE_ID"], "IBLOCK_ID" => $arOffer["PROPERTY_" . $OF_PROP_ID . "_IBLOCK_ID"], "IBLOCK_CODE" => $arIBlockCache[$OF_IBLOCK_ID]["PRODUCT_IBLOCK"]["CODE"], "IBLOCK_EXTERNAL_ID" => $arIBlockCache[$OF_IBLOCK_ID]["PRODUCT_IBLOCK"]["XML_ID"], "IBLOCK_SECTION_ID" => $arOffer["PROPERTY_" . $OF_PROP_ID . "_IBLOCK_SECTION_ID"], "SECTION_CODE" => $arOffer["PROPERTY_" . $OF_PROP_ID . "_IBLOCK_SECTION_CODE"]);
}
}
if (is_array($arElementCache[$OF_ELEMENT_ID])) {
$product_url = CIBlock::ReplaceDetailUrl($arIBlockCache[$OF_IBLOCK_ID]["PRODUCT_IBLOCK"]["DETAIL_PAGE_URL"], $arElementCache[$OF_ELEMENT_ID], $server_name, $arrType);
}
}
}
return $product_url;
}