本文整理汇总了PHP中CCatalogGroup类的典型用法代码示例。如果您正苦于以下问题:PHP CCatalogGroup类的具体用法?PHP CCatalogGroup怎么用?PHP CCatalogGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CCatalogGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSelectedPriceTypeId
public static function getSelectedPriceTypeId()
{
if (is_null(self::$selectedPriceTypeId)) {
$priceTypeId = intval(COption::GetOptionInt('crm', 'selected_catalog_group_id', 0));
if ($priceTypeId < 1) {
$arBaseCatalogGroup = CCatalogGroup::GetBaseGroup();
$priceTypeId = intval($arBaseCatalogGroup['ID']);
}
self::$selectedPriceTypeId = $priceTypeId;
}
return self::$selectedPriceTypeId;
}
示例2: getPriceItems
public function getPriceItems()
{
$items = array();
if (CModule::IncludeModule("catalog")) {
$rsPrice = CCatalogGroup::GetList($v1, $v2);
while ($arPrice = $rsPrice->Fetch()) {
if (($arPrice["CAN_ACCESS"] == "Y" || $arPrice["CAN_BUY"] == "Y") && in_array($arPrice["NAME"], $this->arParams["PRICE_CODE"])) {
$items[$arPrice["NAME"]] = array("ID" => $arPrice["ID"], "CODE" => $arPrice["NAME"], "NAME" => $arPrice["NAME_LANG"], "PRICE" => true, "VALUES" => array("MIN" => array("CONTROL_ID" => htmlspecialcharsbx($this->FILTER_NAME . "_P" . $arPrice["ID"] . "_MIN"), "CONTROL_NAME" => htmlspecialcharsbx($this->FILTER_NAME . "_P" . $arPrice["ID"] . "_MIN")), "MAX" => array("CONTROL_ID" => htmlspecialcharsbx($this->FILTER_NAME . "_P" . $arPrice["ID"] . "_MAX"), "CONTROL_NAME" => htmlspecialcharsbx($this->FILTER_NAME . "_P" . $arPrice["ID"] . "_MAX"))));
}
}
}
return $items;
}
示例3: getPriceTypeList
/**
* Метод вернет список типов цен
*
* @return array
*/
function getPriceTypeList()
{
$result = array();
$selectedType = getSelectedType();
$dbCatalogGroup = CCatalogGroup::GetList(array('SORT' => 'ASC'), array('BASE' => 'N'), false, false, array('ID', ' NAME', 'NAME_LANG'));
while ($type = $dbCatalogGroup->GetNext()) {
if ($type['ID'] == $selectedType) {
$type['SELECTED'] = true;
}
$result[] = $type;
}
return $result;
}
示例4: getPriceItems
public function getPriceItems()
{
$items = array();
if (!empty($this->arParams["PRICE_CODE"])) {
if (CModule::IncludeModule("catalog")) {
$rsPrice = CCatalogGroup::GetList(array('SORT' => 'ASC', 'ID' => 'ASC'), array('=NAME' => $this->arParams["PRICE_CODE"]), false, false, array('ID', 'NAME', 'NAME_LANG', 'CAN_ACCESS', 'CAN_BUY'));
while ($arPrice = $rsPrice->Fetch()) {
if ($arPrice["CAN_ACCESS"] == "Y" || $arPrice["CAN_BUY"] == "Y") {
$items[$arPrice["NAME"]] = array("ID" => $arPrice["ID"], "CODE" => $arPrice["NAME"], "NAME" => strlen($arPrice["NAME_LANG"]) ? $arPrice["NAME_LANG"] : $arPrice["NAME"], "PRICE" => true, "VALUES" => array("MIN" => array("CONTROL_ID" => htmlspecialcharsbx($this->FILTER_NAME . "_P" . $arPrice["ID"] . "_MIN"), "CONTROL_NAME" => htmlspecialcharsbx($this->FILTER_NAME . "_P" . $arPrice["ID"] . "_MIN")), "MAX" => array("CONTROL_ID" => htmlspecialcharsbx($this->FILTER_NAME . "_P" . $arPrice["ID"] . "_MAX"), "CONTROL_NAME" => htmlspecialcharsbx($this->FILTER_NAME . "_P" . $arPrice["ID"] . "_MAX"))));
}
}
}
}
return $items;
}
示例5: getCatalogPrices
private static function getCatalogPrices()
{
if (!isset(self::$catalogPriceCache)) {
self::$catalogPriceCache = array();
if (self::$catalogIncluded === null) {
self::$catalogIncluded = Loader::includeModule('catalog');
}
if (self::$catalogIncluded) {
$rsPrice = CCatalogGroup::GetListEx(array("SORT" => "ASC"), array(), false, false, array("ID", "NAME"));
while ($price = $rsPrice->Fetch()) {
self::$catalogPriceCache[] = $price;
}
}
}
return self::$catalogPriceCache;
}
示例6: __AddCellPriceType
/**
* @param $intRangeID
* @param $strPrefix
* @return string
*/
function __AddCellPriceType($intRangeID, $strPrefix)
{
$dbCatalogGroups = CCatalogGroup::GetList(array("SORT" => "ASC", "NAME" => "ASC", "ID" => "ASC"));
$priceTypeCellOption = '';
while ($arCatalogGroup = $dbCatalogGroups->Fetch()) {
$priceTypeCellOption .= "<option value=" . $arCatalogGroup['ID'] . ">" . htmlspecialcharsbx($arCatalogGroup["NAME"]) . "</option>";
}
return <<<PRICETYPECELL
\t<td width="30%">
\t\t<span class="adm-select-wrap">
\t\t\t<select id="IB_SEG_PRICE_TYPE" class="adm-select" style="width: 169px; max-width: 300px;" name="{$strPrefix}PRICETYPE[{$intRangeID}]" />
\t\t\t\t{$priceTypeCellOption}
\t\t\t</select>
\t\t</span>
\t</td>
PRICETYPECELL;
}
示例7: __cat_setPriceTypes
function __cat_setPriceTypes($arPriceTypes)
{
$arCurrentPriceTypes = array();
$dbRes = CCatalogGroup::GetList();
while ($arRes = $dbRes->Fetch()) {
$arCurrentPriceTypes[$arRes['NAME']] = $arRes;
}
$arLang = __cat_LoadMess(dirname(__FILE__) . '/types.php');
foreach ($arPriceTypes as $type_id => $arFields) {
if (isset($arCurrentPriceTypes[$type_id])) {
continue;
}
foreach ($arLang as $LANG => $arMess) {
$arFields['USER_LANG'][$LANG] = $arMess['CAT_PRICE_TYPE_' . $type_id];
}
// errors're goin by forest
CCatalogGroup::Add($arFields);
}
}
示例8: GetCatalogPrices
public static function GetCatalogPrices($IBLOCK_ID, $arPriceCode)
{
global $USER;
$arCatalogPrices = array();
if (self::$catalogIncluded === null) {
self::$catalogIncluded = Loader::includeModule('catalog');
}
if (self::$catalogIncluded) {
$arCatalogGroupCodesFilter = array();
foreach ($arPriceCode as $value) {
$t_value = trim($value);
if ('' != $t_value) {
$arCatalogGroupCodesFilter[$value] = true;
}
}
$arCatalogGroupsFilter = array();
$arCatalogGroups = CCatalogGroup::GetListArray();
foreach ($arCatalogGroups as $key => $value) {
if (isset($arCatalogGroupCodesFilter[$value['NAME']])) {
$arCatalogGroupsFilter[] = $key;
$arCatalogPrices[$value["NAME"]] = array("ID" => (int) $value["ID"], "TITLE" => htmlspecialcharsbx($value["NAME_LANG"]), "SELECT" => "CATALOG_GROUP_" . $value["ID"]);
}
}
$arPriceGroups = CCatalogGroup::GetGroupsPerms($USER->GetUserGroupArray(), $arCatalogGroupsFilter);
foreach ($arCatalogPrices as $name => $value) {
$arCatalogPrices[$name]["CAN_VIEW"] = in_array($value["ID"], $arPriceGroups["view"]);
$arCatalogPrices[$name]["CAN_BUY"] = in_array($value["ID"], $arPriceGroups["buy"]);
}
} else {
$arPriceGroups = array("view" => array());
$rsProperties = CIBlockProperty::GetList(array(), array("IBLOCK_ID" => $IBLOCK_ID, "CHECK_PERMISSIONS" => "N", "PROPERTY_TYPE" => "N", "MULTIPLE" => "N"));
while ($arProperty = $rsProperties->Fetch()) {
if (in_array($arProperty["CODE"], $arPriceCode)) {
$arPriceGroups["view"][] = htmlspecialcharsbx("PROPERTY_" . $arProperty["CODE"]);
$arCatalogPrices[$arProperty["CODE"]] = array("ID" => (int) $arProperty["ID"], "TITLE" => htmlspecialcharsbx($arProperty["NAME"]), "SELECT" => "PROPERTY_" . $arProperty["ID"], "CAN_VIEW" => true, "CAN_BUY" => false);
}
}
}
return $arCatalogPrices;
}
示例9: GetCatalogPrices
function GetCatalogPrices($IBLOCK_ID, $arPriceCode)
{
global $USER;
$arCatalogPrices = array();
if (CModule::IncludeModule("catalog")) {
$bFromCatalog = true;
$arCatalogGroupCodesFilter = array();
foreach ($arPriceCode as $key => $value) {
$t_value = trim($value);
if (strlen($t_value) > 0) {
$arCatalogGroupCodesFilter[$value] = true;
}
}
$arCatalogGroupsFilter = array();
$arCatalogGroups = CCatalogGroup::GetListArray();
foreach ($arCatalogGroups as $key => $value) {
if (array_key_exists($value["NAME"], $arCatalogGroupCodesFilter)) {
$arCatalogGroupsFilter[] = $key;
$arCatalogPrices[$value["NAME"]] = array("ID" => htmlspecialcharsbx($value["ID"]), "TITLE" => htmlspecialcharsbx($value["NAME_LANG"]), "SELECT" => "CATALOG_GROUP_" . $value["ID"]);
}
}
$arPriceGroups = CCatalogGroup::GetGroupsPerms($USER->GetUserGroupArray(), $arCatalogGroupsFilter);
foreach ($arCatalogPrices as $name => $value) {
$arCatalogPrices[$name]["CAN_VIEW"] = in_array($value["ID"], $arPriceGroups["view"]);
$arCatalogPrices[$name]["CAN_BUY"] = in_array($value["ID"], $arPriceGroups["buy"]);
}
} else {
$bFromCatalog = false;
$arPriceGroups = array("view" => array());
$rsProperties = CIBlockProperty::GetList(array(), array("IBLOCK_ID" => $IBLOCK_ID, "CHECK_PERMISSIONS" => "N", "PROPERTY_TYPE" => "N"));
while ($arProperty = $rsProperties->Fetch()) {
if ($arProperty["MULTIPLE"] == "N" && in_array($arProperty["CODE"], $arPriceCode)) {
$arPriceGroups["view"][] = htmlspecialcharsbx("PROPERTY_" . $arProperty["CODE"]);
$arCatalogPrices[$arProperty["CODE"]] = array("ID" => htmlspecialcharsbx($arProperty["ID"]), "TITLE" => htmlspecialcharsbx($arProperty["NAME"]), "SELECT" => "PROPERTY_" . $arProperty["ID"], "CAN_VIEW" => true, "CAN_BUY" => false);
}
}
}
return $arCatalogPrices;
}
示例10: ReCountFromBase
function ReCountFromBase(&$arFields, &$boolBase)
{
$arBaseGroup = CCatalogGroup::GetBaseGroup();
if (!empty($arBaseGroup))
{
if ($arFields['CATALOG_GROUP_ID'] == $arBaseGroup['ID'])
{
$boolBase = true;
}
else
{
if (!empty($arFields['EXTRA_ID']) && intval($arFields['EXTRA_ID']) > 0)
{
$arExtra = CExtra::GetByID($arFields['EXTRA_ID']);
if (!empty($arExtra))
{
$arFilter = array('PRODUCT_ID' => $arFields['PRODUCT_ID'],'CATALOG_GROUP_ID' => $arBaseGroup['ID']);
if (isset($arFields['QUANTITY_FROM']))
$arFilter['QUANTITY_FROM'] = $arFields['QUANTITY_FROM'];
if (isset($arFields['QUANTITY_TO']))
$arFilter['QUANTITY_TO'] = $arFields['QUANTITY_TO'];
$rsBasePrices = CPrice::GetListEx(
array("QUANTITY_FROM" => "ASC", "QUANTITY_TO" => "ASC"),
$arFilter,
false,
array('nTopCount' => 1),
array('PRICE','CURRENCY')
);
if ($arBasePrice = $rsBasePrices->Fetch())
{
$arFields['CURRENCY'] = $arBasePrice['CURRENCY'];
$arFields['PRICE'] = RoundEx($arBasePrice["PRICE"] * (1 + DoubleVal($arExtra["PERCENTAGE"])/100), CATALOG_VALUE_PRECISION);
}
else
{
$arFields['EXTRA_ID'] = 0;
}
}
else
{
$arFields['EXTRA_ID'] = 0;
}
}
}
}
}
示例11: GetMessage
<tr>
<td><?php
echo GetMessage('YANDEX_PRICE_TYPE');
?>
: </td>
<td><br /><select name="PRICE">
<option value=""<?php
echo $PRICE == "" || $PRICE == 0 ? ' selected' : '';
?>
><?php
echo GetMessage('YANDEX_PRICE_TYPE_NONE');
?>
</option>
<?php
$dbRes = CCatalogGroup::GetList(array('SORT' => 'ASC'), array('ACTIVE' => 'Y', 'ID' => $arGroups), 0, 0, array('ID', 'NAME', 'BASE'));
while ($arRes = $dbRes->GetNext()) {
?>
<option value="<?php
echo $arRes['ID'];
?>
"<?php
echo $PRICE == $arRes['ID'] ? ' selected' : '';
?>
><?php
echo '[' . $arRes['ID'] . '] ' . $arRes['NAME'];
?>
</option>
<?php
}
?>
示例12: array
if ($strUseStoreControl == "Y")
{
$arHeader[] = array(
"id" => "CATALOG_BAR_CODE",
"content" => GetMessage("IBLIST_A_CATALOG_BAR_CODE"),
"title" => "",
"align" => "right",
"default" => false,
);
}
$arCatGroup = array();
$dbCatalogGroups = CCatalogGroup::GetListEx(
array("SORT" => "ASC"),
array("LID"=>LANGUAGE_ID),
false,
false,
array('ID', 'NAME', 'NAME_LANG')
);
while ($arCatalogGroup = $dbCatalogGroups->Fetch())
{
$arHeader[] = array(
"id" => "CATALOG_GROUP_".$arCatalogGroup["ID"],
"content" => htmlspecialcharsex(!empty($arCatalogGroup["NAME_LANG"]) ? $arCatalogGroup["NAME_LANG"] : $arCatalogGroup["NAME"]),
"align" => "right",
"sort" => "CATALOG_PRICE_".$arCatalogGroup["ID"],
);
$arCatGroup[$arCatalogGroup["ID"]] = $arCatalogGroup;
}
$arCatExtra = array();
$db_extras = CExtra::GetList(array("NAME" =>"ASC"));
示例13: GetMessage
echo $ind;
?>
">
<input type="button" value="<?php
echo GetMessage("C2IT_MORE");
?>
" OnClick="ClonePriceSections()">
</td>
</tr>
<script type="text/javascript">
arCatalogGroups = [];
catalogGroupsInd = 0;
</script>
<?php
if (CBXFeatures::IsFeatureEnabled('CatMultiPrice')) {
$dbCatalogGroups = CCatalogGroup::GetList(array("SORT" => "ASC", "NAME" => "ASC", "ID" => "ASC"), array("!BASE" => "Y"));
while ($arCatalogGroup = $dbCatalogGroups->Fetch()) {
?>
<script type="text/javascript">
arCatalogGroups[catalogGroupsInd] = <?php
echo $arCatalogGroup["ID"];
?>
;
catalogGroupsInd++;
</script>
<tr>
<td valign="top" align="right">
<?php
echo GetMessage("C2IT_PRICE_TYPE");
?>
"<?php
示例14: getPrices
protected function getPrices()
{
if ($this->arPrices === null) {
$this->arPrices = array();
$rsPrice = \CCatalogGroup::GetListEx(array("SORT" => "ASC"), array(), false, false, array("ID", "NAME", "NAME_LANG", "BASE"));
while ($price = $rsPrice->Fetch()) {
$this->arPrices[] = $price;
}
}
return $this->arPrices;
}
示例15: init
//.........这里部分代码省略.........
if ($row['DEF'] === 'Y') {
self::$defaultSiteId = $row['LID'];
}
}
self::$weightOptions[$row['LID']] = array('unit' => COption::GetOptionString('sale', 'weight_unit', null, $row['LID']), 'koef' => COption::GetOptionInt('sale', 'weight_koef', null, $row['LID']));
}
unset($i, $row, $result);
// hack, add virtual ID field into StatusLang entity for filtering
$statusEntity = Entity\Base::getInstance('\\Bitrix\\Sale\\Internals\\StatusLang');
if ($statusEntity instanceof \Bitrix\Main\Entity\Base) {
$statusEntity->addField(array('data_type' => 'string', 'expression' => array('%s', 'STATUS_ID')), 'ID');
}
unset($statusEntity);
// hack, add virtual REPS_ORDER field into Shipment entity for filtering system records
$shipmentEntity = Entity\Base::getInstance('\\Bitrix\\Sale\\Internals\\Shipment');
if ($shipmentEntity instanceof \Bitrix\Main\Entity\Base) {
$shipmentEntity->addField(array('data_type' => 'Order', 'reference' => array('=ref.ID' => 'this.ORDER_ID', '!=this.SYSTEM' => array('?', 'Y'))), 'REPS_ORDER');
}
unset($shipmentEntity);
// Initializing list of statuses of orders.
$result = Bitrix\Sale\Internals\StatusLangTable::getList(array('select' => array('STATUS_ID', 'NAME'), 'filter' => array('=LID' => LANGUAGE_ID)));
while ($row = $result->fetch()) {
self::$statuslist[$row['STATUS_ID']] = $row['NAME'];
}
unset($row, $result);
self::$genders = array('M' => GetMessage('USER_MALE'), 'F' => GetMessage('USER_FEMALE'));
// Initializing list of person types.
$result = Bitrix\Sale\Internals\PersonTypeTable::getList(array('select' => array('ID', 'LID', 'NAME')));
while ($row = $result->fetch()) {
self::$personTypes[$row['ID']] = array('LID' => $row['LID'], 'NAME' => $row['NAME']);
}
unset($row, $result);
// Initializing list of pay systems of orders.
$result = Bitrix\Sale\PaySystemTable::getList(array('select' => array('ID', 'LID', 'NAME')));
while ($row = $result->fetch()) {
self::$paySystemList[$row['ID']] = array('value' => $row['NAME'], 'site_id' => $row['LID']);
}
unset($row, $result);
// Initializing list of services and methods of delivery.
$result = \Bitrix\Sale\Delivery\Services\Table::getList(array('select' => array('ID', 'NAME')));
while ($row = $result->fetch()) {
self::$deliveryList[$row['ID']] = array('value' => $row['NAME'], 'site_id' => '');
}
unset($row, $result);
// Obtaining table of correspondences of iblocks to sites.
$result = Bitrix\Iblock\IblockSiteTable::getList();
while ($row = $result->fetch()) {
self::$iblockSite[$row['SITE_ID']][] = $row['IBLOCK_ID'];
}
unset($row, $result);
// Obtaining the list of iblocks which are directories and filling
// a property $catalogSections with sections of these units.
$ent = new CCatalog();
$result = $ent->GetList();
while ($ibRow = $result->Fetch()) {
// Obtaining list of sections of the catalog.
self::$catalogs[] = $ibRow;
$path = array();
$curLevel = $prevLevel = 0;
$sections = CIBlockSection::GetTreeList(array('=IBLOCK_ID' => $ibRow['IBLOCK_ID']));
$row = null;
while ($row = $sections->GetNext()) {
// Formation of an array of identifiers of current and parent sections.
$curLevel = $row['DEPTH_LEVEL'];
for ($i = 0; $i <= $prevLevel - $curLevel; $i++) {
array_pop($path);
}
array_push($path, $row['ID']);
$prevLevel = $curLevel;
self::$catalogSections[$row['ID']] = array('name' => ltrim(str_repeat(' . ', $curLevel) . $row['NAME']), 'path' => $path, 'catalog' => array('ID' => $ibRow['ID'], 'NAME' => $ibRow['NAME']));
}
}
unset($ent, $ibRow, $row, $sections, $result);
// Initialization of the list of warehouses.
$result = Bitrix\Catalog\StoreTable::getList(array('select' => array('ID', 'TITLE')));
while ($row = $result->fetch()) {
self::$productStores[$row['ID']] = $row['TITLE'];
}
unset($row, $result);
// Getting currencies
$obj = new CCurrency();
$by = '';
$order = '';
$result = $obj->GetList($by, $order, LANGUAGE_ID);
while ($row = $result->Fetch()) {
self::$currencies[$row['CURRENCY']] = array('name' => $row['FULL_NAME']);
}
unset($row, $result, $obj, $by, $order);
// Getting types of prices
$obj = new CCatalogGroup();
$result = $obj->GetListEx(array('SORT'), array(), false, false, array('ID', 'NAME', 'BASE', 'NAME_LANG'));
while ($row = $result->Fetch()) {
self::$priceTypes[$row['ID']] = array('name' => empty($row['NAME_LANG']) ? $row['NAME'] : $row['NAME_LANG'], 'base' => $row['BASE'] === 'Y' ? true : false);
}
unset($row, $result, $obj);
// Getting option, which means, it is necessary to display a fractional quantity of goods of no.
self::$fDecimalQuant = COption::GetOptionString('sale', 'QUANTITY_FACTORIAL') == 'Y';
self::initOwners();
}
}