• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CCatalogProduct类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中CCatalogProduct的典型用法代码示例。如果您正苦于以下问题:PHP CCatalogProduct类的具体用法?PHP CCatalogProduct怎么用?PHP CCatalogProduct使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了CCatalogProduct类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: On1CExchAfterIBlockElementAdd

function On1CExchAfterIBlockElementAdd(&$arFields)
{
    // Create catalog records for all iblock elements
    $iblockElementId = intval($arFields['RESULT']);
    if ($iblockElementId > 0) {
        $catalogProduct = new CCatalogProduct();
        $catalogProduct->Add(array('ID' => $iblockElementId, 'QUANTITY' => 0));
    }
    return true;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:10,代码来源:1c_exchange.php


示例2: addCatalogProducts

	protected function addCatalogProducts($arParams){
		if (!CModule::IncludeModule("iblock") && !CModule::IncludeModule("catalog") && !CModule::IncludeModule("sale")):
			return false;
		endif;
		$arFields = array(
			"ID" => $arParams["PRODUCT_ID"],
			"QUANTITY" => $arParams["BALANCE"],
			"CAN_BUY_ZERO" => "Y",
			"NEGATIVE_AMOUNT_TRACE" => "Y",
			"QUANTITY_TRACE" => "Y"
			);
		$db_res = CCatalogProduct::GetList(
			array(),
			array("ID" => $arParams["PRODUCT_ID"]),
			false,
			array()
			);
		if ($ar_res = $db_res->Fetch()):
			if (!CCatalogProduct::Update($ar_res["ID"], $arFields)):
				return false;
			endif;
		else:
			if(!CCatalogProduct::Add($arFields)):
				return false;
			endif;
		endif;
		return true;
	}
开发者ID:akniyev,项目名称:arteva.ru,代码行数:28,代码来源:addProductsPrice.php


示例3: AddToBasket

function AddToBasket($pid, $quantity)
{
    if (CModule::IncludeModule("sale") && CModule::IncludeModule("catalog")) {
        $ar_res = CCatalogProduct::GetByIDEx($pid);
        if ($ar_res) {
            $result = Add2BasketByProductID($pid, $quantity);
            // если ошибки -  $ex = $APPLICATION->GetException();
            if ($result) {
                $arrSendResult['ERROR'] = 'N';
                $arrSendResult['TEXT'] = 'OK';
                echo json_encode($arrSendResult);
            } else {
                $arrSendResult['ERROR'] = 'Y';
                $arrSendResult['TEXT'] = 'Error';
                echo json_encode($arrSendResult);
            }
        } else {
            if (Add2BasketByProductID($pid, $quantity)) {
                $arrSendResult['ERROR'] = 'N';
                $arrSendResult['TEXT'] = 'OK';
                echo json_encode($arrSendResult);
            }
        }
    }
}
开发者ID:VitaliiSestrenskyi,项目名称:sest,代码行数:25,代码来源:Add2BasketByProductID.php


示例4: OnProductCatalogHandler

function OnProductCatalogHandler($ID, $arFields)
{
    Bitrix\Main\Loader::includeModule('iblock');
    Bitrix\Main\Loader::includeModule('catalog');
    define('IBLOCK_ID_PRODUCTS', 2);
    define('IBLOCK_ID_OFFERS', 3);
    $query = new \Bitrix\Main\Entity\Query(Bitrix\Iblock\ElementTable::getEntity());
    $query->setSelect(array("ID", "IBLOCK_ID"))->setFilter(array("ID" => $ID))->setOrder(array("ID" => "ASC"));
    $resElement = $query->exec()->fetch();
    if ($resElement['IBLOCK_ID'] == IBLOCK_ID_PRODUCTS) {
        CIBlockElement::SetPropertyValuesEx($ID, $resElement['IBLOCK_ID'], array("AVAILABLE_QUANTITY_CATALOG" => $arFields['QUANTITY']));
    } elseif ($resElement['IBLOCK_ID'] == IBLOCK_ID_OFFERS) {
        //1
        $rsElementOffer = CIBlockElement::GetList(array(), array("ID" => $ID), false, false, array("ID", "IBLOCK_ID", 'NAME', "PROPERTY_CML2_LINK"))->fetch();
        $resElemOfferProduct = (int) $rsElementOffer['PROPERTY_CML2_LINK_VALUE'];
        //2
        $resOffersCML2 = CIBlockElement::GetList(array(), array("PROPERTY_CML2_LINK" => $resElemOfferProduct, 'IBLOCK_ID' => IBLOCK_ID_OFFERS), false, false, array("ID", "IBLOCK_ID", 'NAME'));
        //3
        $arrOffersIDs = array();
        while ($res = $resOffersCML2->fetch()) {
            $arrOffersIDs[] = $res['ID'];
        }
        //4
        $availQuant = array();
        foreach ($arrOffersIDs as $k => $v) {
            $ar_res_cat = CCatalogProduct::GetList(array("ID" => "DESC"), array("ID" => (int) $v), false, false, array("ID", "QUANTITY", 'ELEMENT_IBLOCK_ID', 'ELEMENT_NAME'))->fetch();
            $availQuant[] = $ar_res_cat['QUANTITY'];
        }
        //5
        $minAvailQuant = (int) min($availQuant);
        //6
        $resUpdateSCU = CIBlockElement::SetPropertyValuesEx($resElemOfferProduct, IBLOCK_ID_PRODUCTS, array("AVAILABLE_QUANTITY_CATALOG" => $minAvailQuant));
    }
}
开发者ID:VitaliiSestrenskyi,项目名称:sest,代码行数:34,代码来源:scu_sort_available.php


示例5: getPriceObj

 protected function getPriceObj()
 {
     if ($this->price === null) {
         $this->price = \CCatalogProduct::GetOptimalPrice($this->ID);
         //            echo '<pre>'.print_r($this->price,true).'</pre>';
     }
     return $this->price;
 }
开发者ID:ASDAFF,项目名称:bitrix_lib,代码行数:8,代码来源:Product.class.php


示例6: getProductMeasures

 public static function getProductMeasures($productID)
 {
     if (!Main\Loader::includeModule('catalog')) {
         throw new Main\SystemException("Could not load 'catalog' module.");
     }
     $productIDs = is_array($productID) ? $productID : array($productID);
     $measure2product = array();
     if (!empty($productIDs)) {
         $productEntity = new \CCatalogProduct();
         $dbProductResult = $productEntity->GetList(array(), array('@ID' => $productIDs), false, false, array('ID', 'MEASURE'));
         if (is_object($dbProductResult)) {
             while ($productFields = $dbProductResult->Fetch()) {
                 $measureID = isset($productFields['MEASURE']) ? intval($productFields['MEASURE']) : 0;
                 if ($measureID <= 0) {
                     continue;
                 }
                 if (isset($measure2product[$measureID])) {
                     $measure2product[$measureID] = array();
                 }
                 $measure2product[$measureID][] = intval($productFields['ID']);
             }
         }
     }
     $result = array();
     if (!empty($measure2product)) {
         $dbMeasureResult = \CCatalogMeasure::getList(array(), array('@ID' => array_keys($measure2product)), false, false, array('ID', 'CODE', 'SYMBOL_RUS', 'SYMBOL_INTL', 'IS_DEFAULT'));
         if (is_object($dbMeasureResult)) {
             while ($measureFields = $dbMeasureResult->Fetch()) {
                 $measureID = intval($measureFields['ID']);
                 $measureInfo = array('ID' => $measureID, 'CODE' => intval($measureFields['CODE']), 'IS_DEFAULT' => isset($measureFields['IS_DEFAULT']) && $measureFields['IS_DEFAULT'] === 'Y', 'SYMBOL' => isset($measureFields['SYMBOL_RUS']) ? $measureFields['SYMBOL_RUS'] : $measureFields['SYMBOL_INTL']);
                 foreach ($measure2product[$measureID] as $productID) {
                     $result[$productID] = array($measureInfo);
                 }
             }
         }
     }
     return $result;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:38,代码来源:measure.php


示例7: loadFromDatabase

 protected function loadFromDatabase()
 {
     if (!isset($this->fields)) {
         $this->fields = \CCatalogProduct::getByID($this->id);
         if (is_array($this->fields)) {
             if ($this->fields["MEASURE"] > 0) {
                 $this->fields["MEASURE"] = new ElementCatalogMeasure($this->fields["MEASURE"]);
             }
             $this->fields["STORE"] = new ElementCatalogStoreList(0);
         } else {
             $this->fields["STORE"] = new ElementCatalogStoreList(0);
         }
     }
     return is_array($this->fields);
 }
开发者ID:ASDAFF,项目名称:open_bx,代码行数:15,代码来源:elementcatalog.php


示例8: getProductList

 /**
  * @param Basket $basketCollection
  * @param array $productList
  * @return array
  */
 public static function getProductList(Basket $basketCollection, array $productList = array())
 {
     $productBasketIndex = array();
     $result = array();
     foreach ($basketCollection as $basketKey => $basketItem) {
         $productId = intval($basketItem->getProductId());
         if (intval($productId < 0) || sizeof($productList) > 0 && in_array($productId, $productList)) {
             continue;
         }
         $productBasketIndex[$basketKey] = $productId;
     }
     $rsProducts = \CCatalogProduct::GetList(array(), array('ID' => $productBasketIndex), false, false, array('ID', 'CAN_BUY_ZERO', 'NEGATIVE_AMOUNT_TRACE', 'QUANTITY_TRACE', 'QUANTITY', 'QUANTITY_RESERVED'));
     while ($arProduct = $rsProducts->Fetch()) {
         $result[$arProduct['ID']] = $arProduct;
     }
     return $result;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:22,代码来源:reservation.php


示例9: add_element

function add_element($iblock_id, $section_id, $NAME, $PRICE_EUR, $P, $DETAIL_PICTURE)
{
    $el = new CIBlockElement();
    //test_dump($P);
    $arFields = array("IBLOCK_ID" => $iblock_id, "NAME" => $NAME, "CODE" => $P["ARTNUMBER"], "ACTIVE" => "Y", "IBLOCK_SECTION_ID" => $section_id, "DETAIL_TEXT" => $P["DESCRIPTION_TEXT"], "DETAIL_TEXT_TYPE" => "html", "PROPERTY_VALUES" => $P, "DETAIL_PICTURE" => $DETAIL_PICTURE);
    if ($last_el_id = $el->Add($arFields)) {
        echo "New ID: " . $last_el_id . "<br>";
        $arFields = array("ID" => $last_el_id, "VAT_INCLUDED" => "Y");
        if (CCatalogProduct::Add($arFields)) {
            echo "Добавили параметры товара к элементу каталога " . $last_el_id . "<br>";
            $arFields = array("PRODUCT_ID" => $last_el_id, "CATALOG_GROUP_ID" => 1, "PRICE" => $PRICE_EUR, "CURRENCY" => "EUR");
            CPrice::Add($arFields);
        } else {
            echo "Ошибка добавления параметров товаров";
        }
    } else {
        echo "Error: " . $el->LAST_ERROR . "<br>";
    }
}
开发者ID:akniyev,项目名称:tdpersona2,代码行数:19,代码来源:add_elements19.php


示例10: CheckFields

 /**
  * <p>Метод служит для проверки параметров, переданных в методы <a href="http://dev.1c-bitrix.ru/api_help/catalog/classes/ccatalogproductgroups/ccatalogproductgroups.add.php">CCatalogProductGroups::Add</a> и <a href="http://dev.1c-bitrix.ru/api_help/catalog/classes/ccatalogproductgroups/ccatalogproductgroups.update.php">CCatalogProductGroups::Update</a>.</p>
  *
  *
  *
  *
  * @param string $ACTION  Указывает, для какого метода идет проверка. Возможные значения:
  * <br><ul> <li> <b>ADD</b> - для метода <a
  * href="http://dev.1c-bitrix.ru/api_help/catalog/classes/ccatalogproductgroups/ccatalogproductgroups.add.php">CCatalogProductGroups::Add</a>;</li>
  * <li> <b>UPDATE</b> - для метода <a
  * href="http://dev.1c-bitrix.ru/api_help/catalog/classes/ccatalogproductgroups/ccatalogproductgroups.update.php">CCatalogProductGroups::Update</a>.</li>
  * </ul>
  *
  *
  *
  * @param array &$arFields  Ассоциативный массив параметров информации о связи товаров и
  * групп пользователей. Допустимые ключи: <ul> <li> <b>PRODUCT_ID</b> - код
  * товара;</li> <li> <b>GROUP_ID</b> - код группы пользователей;</li> <li> <b>ACCESS_LENGTH</b>
  * - длина периода, на который пользователь привязывается к группе
  * пользователей при покупке товара (0 - навсегда);</li> <li>
  * <b>ACCESS_LENGTH_TYPE</b> - тип периода, на который пользователь
  * привязывается к группе пользователей при покупке товара ("H" - час,
  * "D" - сутки, "W" - неделя, "M" - месяц, "Q" - квартал, "S" - полугодие, "Y" -
  * год).</li> </ul>
  *
  *
  *
  * @param int $ID = 0 Код записи с информацией о связи товаров и групп пользователей, к
  * которым пользователь привязывается при покупке товаров.
  * Параметр является необязательным и имеет смысл только для $ACTION =
  * 'UPDATE'.
  *
  *
  *
  * @return bool <p> В случае корректности переданных параметров возвращает true,
  * иначе - false. Если функция вернула false, с помощью $APPLICATION-&gt;GetException()
  * можно получить текст ошибок.</p>
  *
  *
  * <h4>See Also</h4> 
  * <ul> <li><a href="http://dev.1c-bitrix.ru/api_help/catalog/fields.php">Структура таблицы</a></li> <li><a
  * href="http://dev.1c-bitrix.ru/api_help/catalog/classes/ccatalogproductgroups/ccatalogproductgroups.add.php">CCatalogProductGroups::Add</a></li>
  * <li><a
  * href="http://dev.1c-bitrix.ru/api_help/catalog/classes/ccatalogproductgroups/ccatalogproductgroups.update.php">CCatalogProductGroups::Update</a></li>
  * </ul> </ht<br><br>
  *
  *
  * @static
  * @link http://dev.1c-bitrix.ru/api_help/catalog/classes/ccatalogproductgroups/checkfields.php
  * @author Bitrix
  */
 public static function CheckFields($ACTION, &$arFields, $ID = 0)
 {
     if ((is_set($arFields, "PRODUCT_ID") || $ACTION == "ADD") && intval($arFields["PRODUCT_ID"]) <= 0) {
         return false;
     }
     if ((is_set($arFields, "GROUP_ID") || $ACTION == "ADD") && intval($arFields["GROUP_ID"]) <= 0) {
         return false;
     }
     if (is_set($arFields, "ACCESS_LENGTH") || $ACTION == "ADD") {
         $arFields["ACCESS_LENGTH"] = intval($arFields["ACCESS_LENGTH"]);
         if ($arFields["ACCESS_LENGTH"] < 0) {
             $arFields["ACCESS_LENGTH"] = 0;
         }
     }
     if ((is_set($arFields, "ACCESS_LENGTH_TYPE") || $ACTION == "ADD") && !array_key_exists($arFields["ACCESS_LENGTH_TYPE"], CCatalogProduct::GetTimePeriodTypes(true))) {
         $arFields["ACCESS_LENGTH_TYPE"] = CCatalogProduct::TIME_PERIOD_DAY;
     }
     return true;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:70,代码来源:product_group.php


示例11: editContent

 public function editContent(&$content)
 {
     $replaced_template = "<!--Mneniya.pro-->";
     if (strpos($content, $replaced_template) !== false) {
         if (CModule::IncludeModule("catalog")) {
             $product_id = 0;
             if (isset($_SESSION['VIEWED_PRODUCT']) && $_SESSION['VIEWED_PRODUCT']) {
                 $product_id = $_SESSION['VIEWED_PRODUCT'];
             } else {
                 $product_id = $_SESSION['LAST_VIEW_ID'];
             }
             $product_info = CCatalogProduct::GetByIDEx($product_id);
             $settings = unserialize(COption::GetOptionString("pimentos.mneniyapro", "settings"));
             if (isset($settings["code"]) && $settings["code"]) {
                 $content = str_replace($replaced_template, '<div class="mp-prod_id" style="display:none">' . $product_id . '</div>' . '<div class="mp-prod_name" style="display:none">' . $product_info['NAME'] . '</div>' . $settings["code"], $content);
             }
         }
     }
 }
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:19,代码来源:include.php


示例12: updateAll

 public static function updateAll($page = 0, &$total, $perPage = CAutoPriceUpdater::LIMIT)
 {
     $list = CCatalogProduct::GetList(array(), array('IBLOCK_ID' => self::enabledCatalogs()), false, array('iNumPage' => $page + 1, 'nPageSize' => $perPage), array('ID'));
     $total = $list->NavPageCount;
     if ($page + 1 > $list->NavPageCount) {
         return false;
     }
     $priceType = COption::GetOptionInt('autoprice', 'priceTypes', 0);
     while ($res = $list->Fetch()) {
         $price = CPrice::GetBasePrice($res['ID'], false, false);
         $priseRub = floatval($price * self::$usdRate);
         if ($priseRub < 1000 && self::$extras[0]) {
             self::setExtra($res['ID'], $priceType, self::$extras[0]);
         } elseif ($priseRub < 10000 && self::$extras[1]) {
             self::setExtra($res['ID'], $priceType, self::$extras[1]);
         } elseif ($priseRub < 100000 && self::$extras[2]) {
             self::setExtra($res['ID'], $priceType, self::$extras[2]);
         }
     }
     return $page + 1 < $total;
 }
开发者ID:ASDAFF,项目名称:module.markup,代码行数:21,代码来源:CQuetzalMarkupPriceUpdate.php


示例13: get_ib_items_list

 private static function get_ib_items_list($arFilter, $arSelectFields, $with_prices = false)
 {
     if (!CModule::IncludeModule("iblock")) {
         return false;
     }
     $arItems = array();
     $res = CIBlockElement::GetList(array("SORT" => "ASC", "NAME" => "ASC"), $arFilter, false, false, $arSelectFields);
     while ($item = $res->GetNext()) {
         if ($with_prices) {
             $item["PRICE"] = CCatalogProduct::GetOptimalPrice($item["ID"], self::DEFAULT_PRICE_ID, isset($GLOBALS['USER']) && $GLOBALS['USER'] ? $GLOBALS['USER']->GetUserGroupArray() : 0);
             if (isset($item["PRICE"]["RESULT_PRICE"]) && $item["PRICE"]["RESULT_PRICE"]) {
                 $item["PRICE_VALUE"] = $item["PRICE"]["RESULT_PRICE"]["BASE_PRICE"];
                 $item["PRICE_STR_VALUE"] = CurrencyFormat($item["PRICE"]["RESULT_PRICE"]["BASE_PRICE"], $item["PRICE"]["RESULT_PRICE"]["CURRENCY"]);
             } else {
                 $item["PRICE_VALUE"] = 0;
                 $item["PRICE_STR_VALUE"] = "";
             }
         }
         $arItems[$item["ID"]] = $item;
     }
     return $arItems;
 }
开发者ID:romlg,项目名称:bitrixcode,代码行数:22,代码来源:DrclinicsHelper.php


示例14: addToBascket

    function addToBascket($arItems){
        $num = 0;
        foreach($arItems as $item){
            $tovar=CCatalogProduct::GetByIDEx($item["ID"]);
            if(intval($item["COUNT"])<=$tovar["PRODUCT"]["QUANTITY"]&&intval($item["COUNT"])>0){
                Add2BasketByProductID($item["ID"],intval($item["COUNT"]));
                $num++;
            }
        }
       ?> 
       
       <script>
                
                $(".CartLink span").text('(<?php 
echo $num;
?>
)');
                $('body,html').animate({scrollTop: 0}, 2);
       </script>

       <?
    }
开发者ID:ASDAFF,项目名称:bitrix-solution.video,代码行数:22,代码来源:calculate.php


示例15: getAvailableQuantity

function getAvailableQuantity($arBasketItems)
{
    if (empty($arBasketItems) || !is_array($arBasketItems)) {
        return array();
    }
    if ($catalogIncluded === null) {
        $catalogIncluded = Loader::includeModule('catalog');
    }
    if (!$catalogIncluded) {
        return false;
    }
    $arElementId = array();
    $productMap = array();
    foreach ($arBasketItems as $key => $arItem) {
        $arElementId[$arItem['PRODUCT_ID']] = $arItem['PRODUCT_ID'];
        if (!isset($productMap[$arItem['PRODUCT_ID']])) {
            $productMap[$arItem['PRODUCT_ID']] = array();
        }
        $productMap[$arItem['PRODUCT_ID']][] = $key;
    }
    unset($key, $arItem);
    if (!empty($arElementId)) {
        $productIterator = CCatalogProduct::GetList(array(), array('ID' => $arElementId), false, false, array('ID', 'QUANTITY'));
        while ($product = $productIterator->Fetch()) {
            if (!isset($productMap[$product['ID']])) {
                continue;
            }
            foreach ($productMap[$product['ID']] as $key) {
                $arBasketItems[$key]['AVAILABLE_QUANTITY'] = $product['QUANTITY'];
            }
            unset($key);
        }
        unset($product, $productIterator);
    }
    unset($productMap, $arElementId);
    return $arBasketItems;
}
开发者ID:Andreyjktl,项目名称:rezina74,代码行数:37,代码来源:result_modifier.php


示例16: getFavoriteProducts

/**
 * [getFavoriteProducts description]
 * @param  array $arFavorites
 * @return array products
 */
function getFavoriteProducts($arFavorites)
{
    global $USER;
    foreach ($arFavorites as $key => $id) {
        $arSelect = array();
        $arFilter = array("IBLOCK_ID" => 17, "ACTIVE" => "Y", "ID" => $id);
        $res = CIBlockElement::GetList(array(), $arFilter, false, false, $arSelect);
        if ($ob = $res->GetNextElement()) {
            $arItems = $ob->GetFields();
            $arItems["PROPERTIES"] = $ob->GetProperties();
            $dbPrice = CPrice::GetList(array("QUANTITY_FROM" => "ASC", "QUANTITY_TO" => "ASC", "SORT" => "ASC"), array("PRODUCT_ID" => $arItems["ID"]), false, false, array("ID", "CATALOG_GROUP_ID", "PRICE", "CURRENCY", "QUANTITY_FROM", "QUANTITY_TO"));
            if ($arPrice = $dbPrice->Fetch()) {
                $arDiscounts = CCatalogDiscount::GetDiscountByPrice($arPrice["ID"], $USER->GetUserGroupArray(), "N", SITE_ID);
                $discountPrice = CCatalogProduct::CountPriceWithDiscount($arPrice["PRICE"], $arPrice["CURRENCY"], $arDiscounts);
                $arPrice["DISCOUNT_VALUE"] = $discountPrice;
                $arItems["PRICES"] = $arPrice;
            }
        }
        if ($arItems) {
            $arFav[] = $arItems;
        }
    }
    return $arFav;
}
开发者ID:akniyev,项目名称:arteva.ru,代码行数:29,代码来源:functions.php


示例17: getProductDataToFillBasket


//.........这里部分代码省略.........
					$columnCode = str_replace("_VALUE", "", $key);
					$arElement[$key] = getIblockPropInfo($value, $arPropertyInfo[$columnCode], array("WIDTH" => 90, "HEIGHT" => 90));
				}
			}
		}
		unset($arElement);

		if (isset($arProductData[$productId]))
			$arElementInfo = $arProductData[$productId];

		if (isset( $arSku2Parent[$productId]))
			$arParent = $arProductData[$arSku2Parent[$productId]];

		if (!empty($arSku2Parent)) // if sku element doesn't have value of some property - we'll show parent element value instead
		{
			foreach ($arUserColumns as $field)
			{
				$fieldVal = $field."_VALUE";
				$parentId = $arSku2Parent[$productId];

				if ((!isset($arElementInfo[$fieldVal]) || (isset($arElementInfo[$fieldVal]) && strlen($arElementInfo[$fieldVal]) == 0))
					&& (isset($arProductData[$parentId][$fieldVal]) && !empty($arProductData[$parentId][$fieldVal]))) // can be array or string
				{
					$arElementInfo[$fieldVal] = $arProductData[$parentId][$fieldVal];
				}
			}
			if (strpos($arElementInfo["~XML_ID"], '#') === false)
			{
				$arElementInfo["~XML_ID"] = $arParent['~XML_ID'].'#'.$arElementInfo["~XML_ID"];
			}
		}

		$arElementInfo["MODULE"] = "catalog";
		$arElementInfo["PRODUCT_PROVIDER_CLASS"] = "CCatalogProductProvider";

		$arElementInfo["PRODUCT_ID"] = $arElementInfo["ID"];

		if ($arElementInfo["IBLOCK_ID"] > 0)
		{
			$arElementInfo["EDIT_PAGE_URL"] = CIBlock::GetAdminElementEditLink($arElementInfo["IBLOCK_ID"], $arElementInfo["PRODUCT_ID"], array(
				"find_section_section" => $arElementInfo["IBLOCK_SECTION_ID"],
				'WF' => 'Y',
			));
		}

		$arBuyerGroups = CUser::GetUserGroup($userId);

		// price
		$arPrice = CCatalogProduct::GetOptimalPrice($arElementInfo["ID"], 1, $arBuyerGroups, "N", array(), $LID);
		$currentPrice = $arPrice["DISCOUNT_PRICE"];
		$arElementInfo["PRICE"] = $currentPrice;
		$arElementInfo["CURRENCY"] = $arPrice["PRICE"]["CURRENCY"];
		$arElementInfo["DISCOUNT_PRICE"] = $arPrice["PRICE"]["PRICE"] - $arPrice["DISCOUNT_PRICE"];
		$currentTotalPrice = ($arElementInfo["PRICE"] + $arElementInfo["DISCOUNT_PRICE"]);
		$discountPercent = 0;
		if ($arElementInfo["DISCOUNT_PRICE"] > 0)
			$discountPercent = intval(($arElementInfo["DISCOUNT_PRICE"] * 100) / $currentTotalPrice);

		$rsProducts = CCatalogProduct::GetList(
			array(),
			array('ID' => $productId),
			false,
			false,
			array('ID', 'QUANTITY', 'WEIGHT', 'MEASURE', 'TYPE', 'BARCODE_MULTI')
		);
		if (!($arProduct = $rsProducts->Fetch()))
开发者ID:akniyev,项目名称:arteva.ru,代码行数:67,代码来源:admin_tool.php


示例18: OnIBlockElementDelete

	public static function OnIBlockElementDelete($ProductID)
	{
		global $DB;
		$ProductID = intval($ProductID);

		return CCatalogProduct::Delete($ProductID);
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:7,代码来源:product.php


示例19: array

                                    } else {
                                        $val = $res ? "Y" : "N";
                                    }
                                    $arBasket["STORES"][$storeId]["BARCODE"][] = $arRes["BARCODE"];
                                    $arBasket["STORES"][$storeId]["BARCODE_FOUND"][] = $val;
                                } else {
                                    $arBasket["STORES"][$storeId]["QUANTITY"] = $arRes["QUANTITY"];
                                    $arBasket["STORES"][$storeId]["QUANTITY_DEDUCTED"] = $arRes["DEDUCTED"] == "Y" ? "Y" : "N";
                                }
                            }
                        }
                    }
                    $arBasket["HAS_SAVED_QUANTITY"] = "Y";
                    $arBasket["HAS_SAVED_BARCODES"] = true;
                    $ind++;
                }
            }
        }
    }
    $arResult["BASKET"][$arBasket["ID"]] = $arBasket;
}
if (CModule::IncludeModule('catalog')) {
    $rsCatProd = CCatalogProduct::GetList(array(), array("ID" => $arProdIds), false, false, array("ID", "QUANTITY"));
    while ($arCatProd = $rsCatProd->Fetch()) {
        if ($arResult["BASKET"][$arProdIdsPrIds[$arCatProd["ID"]]]["MODULE"] == "catalog") {
            $arResult["BASKET"][$arProdIdsPrIds[$arCatProd["ID"]]]["BALANCE"] = FloatVal($arCatProd["QUANTITY"]);
        }
    }
}
$arResult["USE_STORES"] = $useStores;
$this->IncludeComponentTemplate($templatePage);
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:component.php


示例20: FloatVal

										?>
										<td class="COLUMN_QUANTITY">
											<?echo $arItem["QUANTITY"]."&nbsp".$measure?>
										</td>
										<?
									}

									if ($columnCode == "COLUMN_REMAINING_QUANTITY")
									{
										?>
										<td class="COLUMN_REMAINING_QUANTITY">
											<?
											$balance = 0;
											if ($arItem["MODULE"] == "catalog" && $bUseCatalog)
											{
												$ar_res = CCatalogProduct::GetByID($arItem["PRODUCT_ID"]);
												$balance = FloatVal($ar_res["QUANTITY"]);
											}
											?>
											<?echo $balance?>
										</td>
										<?
									}

									if ($columnCode == "COLUMN_PROPS")
									{
										?>
										<td class="COLUMN_PROPS">
											<?
											if (!empty($arBasketProps[$arItem["ID"]]) && is_array($arBasketProps[$arItem["ID"]]))
											{
开发者ID:akniyev,项目名称:arteva.ru,代码行数:31,代码来源:order_detail.php



注:本文中的CCatalogProduct类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CCatalogProductSet类代码示例发布时间:2022-05-23
下一篇:
PHP CCatalogMeasureRatio类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap