); $arMatrix[$keyOffer] = $arOneRow; } if (-1 == $intSelected) $intSelected = 0; $arResult['JS_OFFERS'] = $arMatrix; $arResult['OFFERS_SELECTED'] = $intSelected; $arResult['OFFERS_IBLOCK'] = $arSKU['IBLOCK_ID']; } if ($arResult['MODULES']['catalog'] && $arResult['CATALOG'] && CCatalogProduct::TYPE_PRODUCT == $arResult['CATALOG_TYPE']) { CIBlockPriceTools::setRatioMinPrice($arResult, true); } if (!empty($arResult['DISPLAY_PROPERTIES'])) { foreach ($arResult['DISPLAY_PROPERTIES'] as $propKey => $arDispProp) { if ('F' == $arDispProp['PROPERTY_TYPE']) unset($arResult['DISPLAY_PROPERTIES'][$propKey]); } } $arResult['SKU_PROPS'] = $arSKUPropList; $arResult['DEFAULT_PICTURE'] = $arEmptyPreview; $info = wfIBSearchElementsByProp("24",array("ID"=>$arResult["PROPERTIES"]["OPTIONS"]["VALUE"]),array("CODE")); $arResult["WF-OPTIONS"] = $info; ?>
$section = $vars["SECTION"]; } else { if ($arItem['ITEM_ID'][0] == "S") { $section = array(); $section_id = intval(substr($arItem['ITEM_ID'], 1)); $arIBlockSection = GetIBlockSection2($section_id); $image = CFile::GetFileArray($arIBlockSection["PICTURE"]); $image = $image["SRC"]; if (!$image) { $section["NOT_IMAGE"] = true; } if (CCatalog::GetByID($arItem['PARAM2'])) { $section["CATALOG"] = true; } } else { $arElement = wfIBSearchElementsByProp(false, array("ID" => $arItem['ITEM_ID']), array("PROPERTY_BRAND_REF", "PROPERTY_MANUFACTURER", "DETAIL_PICTURE")); $image = $arElement[0]["DETAIL_PICTURE"]; $producer = $arElement[0]["BRAND_REF"]; $brandCountry = $arElement[0]["MANUFACTURER"]; } $ResizeParams = array('width' => $arParams['WIDTH'], 'height' => $arParams['HEIGHT']); $ResizeImage = CFile::ResizeImageGet($image, $ResizeParams, BX_RESIZE_IMAGE_PROPORTIONAL, true); $pathResizeImage = $ResizeImage['src']; } if ($obCache->StartDataCache()) { $obCache->EndDataCache(array("SECTION" => $section, "PRODUCT_PICTURE_SRC" => $pathResizeImage, "PRODUCT_BRAND" => $producer, "PRODUCT_COUNTRY" => $brandCountry)); } $arItem['SECTION'] = $section; $arItem['PRODUCT_PICTURE_SRC'] = $pathResizeImage; $arItem['PRODUCT_BRAND'] = $producer; $arItem['PRODUCT_COUNTRY'] = $brandCountry;
<?php if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { die; } ?> <?php $ids = array(); foreach ($arResult as $key => $val) { $ids[] = $val["PRODUCT_ID"]; $img = ""; if ($val["DETAIL_PICTURE"] > 0) { $img = $val["DETAIL_PICTURE"]; } elseif ($val["PREVIEW_PICTURE"] > 0) { $img = $val["PREVIEW_PICTURE"]; } $file = CFile::ResizeImageGet($img, array('width' => $arParams["VIEWED_IMG_WIDTH"], 'height' => $arParams["VIEWED_IMG_HEIGHT"]), BX_RESIZE_IMAGE_PROPROTIONAL, true); $val["PICTURE"] = $file; $arResult[$key] = $val; } $elems = wfIBSearchElementsByProp($arResult[0]["IBLOCK_ID"], array("ID" => $ids), array("PROPERTY_NEWPRODUCT", "PROPERTY_SALELEADER", "PROPERTY_SPECIALOFFER")); $newElems = array(); foreach ($elems as $elem) { $newElems[$elem["ID"]] = $elem; } $arResult["ELEMS"] = $newElems;
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php"); CModule::IncludeModule("iblock"); CModule::IncludeModule("catalog"); CModule::IncludeModule("sale"); include_once "../wfunctions/iblocks.php"; $id = $_POST["id"]; $price = $_POST["cost"]; $rWare = CCatalogProduct::GetList(array("SORT"=>"ASC"),array("ID"=>$id),false,false,false); $ware = $rWare->Fetch(); $name = $ware["ELEMENT_NAME"]; $optionNames = ""; if(!empty($_POST["options"])){ $opts = wfIBSearchElementsByProp("24",array("ID"=>$_POST["options"]),array("CODE")); foreach($opts as $option){ $optionNames = $option["NAME"]; } $name .= " ({$optionNames})"; } /*if(!empty($_POST["credit"])){ $optionNames .= ", ".($_POST["credit"]); }*/ $arFields = array( "PRODUCT_ID" => $id, "PRODUCT_PRICE_ID" => 0, "PRICE" => $price, "CURRENCY" => "RUB", "WEIGHT" => 0,
<?php require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php"; CModule::IncludeModule("iblock"); CModule::IncludeModule("catalog"); CModule::IncludeModule("sale"); include_once "../wfunctions/iblocks.php"; $id = $_POST["id"]; $price = $_POST["cost"]; $rWare = CCatalogProduct::GetList(array("SORT" => "ASC"), array("ID" => $id), false, false, false); $ware = $rWare->Fetch(); $name = $ware["ELEMENT_NAME"]; $optionNames = ""; if (!empty($_POST["options"])) { $opts = wfIBSearchElementsByProp("#IBLOCK_OPTIONS#", array("ID" => $_POST["options"]), array("CODE")); foreach ($opts as $option) { $optionNames = $option["NAME"]; } $name .= " ({$optionNames})"; } /*if(!empty($_POST["credit"])){ $optionNames .= ", ".($_POST["credit"]); }*/ $arFields = array("PRODUCT_ID" => $id, "PRODUCT_PRICE_ID" => 0, "PRICE" => $price, "CURRENCY" => "RUB", "WEIGHT" => 0, "QUANTITY" => 1, "LID" => LANG, "DELAY" => "N", "CAN_BUY" => "Y", "NAME" => $name, "NOTES" => ""); /*$arProps = array(); $arProps[] = array( "NAME" => "Содержимое", "CODE" => "WF_PACK_CONTENT", "VALUE" => "$names" );