Exemplo n.º 1
0
}
$arResult['PRODUCT_ID'] = $productID;
$product = $productID > 0 ? CCrmProduct::GetByID($productID, true) : false;
$arResult['CATALOG_ID'] = $catalogID = isset($product['CATALOG_ID']) ? intval($product['CATALOG_ID']) : CCrmCatalog::EnsureDefaultExists();
if (!$product) {
    ShowError(GetMessage('CRM_PRODUCT_NOT_FOUND'));
    @define('ERROR_404', 'Y');
    if ($arParams['SET_STATUS_404'] === 'Y') {
        CHTTP::SetStatus("404 Not Found");
    }
    return;
}
// Product properties
$arPropUserTypeList = CCrmProductPropsHelper::GetPropsTypesByOperations(false, 'view');
$arResult['PROP_USER_TYPES'] = $arPropUserTypeList;
$arProps = CCrmProductPropsHelper::GetProps($catalogID, $arPropUserTypeList);
$arResult['PROPS'] = $arProps;
$arResult['PRODUCT'] = $product;
$arResult['FORM_ID'] = 'CRM_PRODUCT_SHOW';
$arResult['GRID_ID'] = 'CRM_PRODUCT_LIST';
// Product properties values
/*$arResult['PRODUCT_PROPS'] = array();*/
$arPropertyValues = array();
if ($productID > 0) {
    $rsProperties = CIBlockElement::GetProperty($catalogID, $productID, array('sort' => 'asc', 'id' => 'asc', 'enum_sort' => 'asc', 'value_id' => 'asc'), array('ACTIVE' => 'Y', 'EMPTY' => 'N', 'CHECK_PERMISSIONS' => 'N'));
    while ($arProperty = $rsProperties->Fetch()) {
        if (isset($arProperty['USER_TYPE']) && !empty($arProperty['USER_TYPE']) && !array_key_exists($arProperty['USER_TYPE'], $arPropUserTypeList)) {
            continue;
        }
        $propID = 'PROPERTY_' . $arProperty['ID'];
        if (!isset($arPropertyValues[$propID])) {
Exemplo n.º 2
0
 protected function initializePropertiesInfo($catalogID)
 {
     if ($this->userTypes === null) {
         $this->userTypes = CCrmProductPropsHelper::GetPropsTypesByOperations(false, 'rest');
     }
     if ($this->properties === null) {
         $this->properties = CCrmProductPropsHelper::GetProps($catalogID, $this->userTypes);
     }
 }