<?
require_once($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/prolog_before.php");
CModule::IncludeModule("iblock");
$dom = new domDocument("1.0", 'utf-8');
$xml = $dom->createElement("xml");
$xml ->setAttributeNS(null, 'version', '1.0');
$xml ->setAttributeNS(null, 'encoding', 'utf-8');
$dom->appendChild($xml);
$urlset = $dom->createElement("urlset");
$urlset->setAttributeNS('http://www.w3.org/2000/xmlns/','xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');
$urlset->setAttributeNS('http://www.w3.org/2000/xmlns/','xmlns:image','http://www.google.com/schemas/sitemap-image/1.1');
$arSelect = Array("ID", "NAME", "DETAIL_PAGE_URL", "PREVIEW_PICTURE");
$arFilter = Array("IBLOCK_ID"=>8, "SECTION_ID"=>100, "INCLUDE_SUBSECTIONS" => "Y"); //ID Инфоблока и ID раздела с элементами
$rsElement = CIBlockElement::GetList(Array("NAME" => "ASC"), $arFilter, false, Array("nPageSize"=>5), $arSelect);
$arResult["ITEMS"] = array();
while($obElement = $rsElement->GetNextElement())
{
$arItem = $obElement->GetFields();
$arItem["PROPERTIES"] = $obElement->GetProperties();
$google_link = 'https://site.ru'.$arItem[DETAIL_PAGE_URL];
$google_img = 'https://site.ru'.CFile::GetPath($arItem[PREVIEW_PICTURE]);
$url = $dom->createElement("url");
$login = $dom->createElement("loc", $google_link);
$url->appendChild($login);
$image = $dom->createElement("image:image");
$image2 = $dom->createElement("image:loc", $google_img);
$image->appendChild($image2);
$url->appendChild($image);
$urlset->appendChild($url);
};
$xml->appendChild($urlset);
$dom->save("img.xml"); //в корне директории откуда запускаем скрипт
echo 'Готово';
?>
214 дней
есть свойство БРЕНД
фильтровать выдачу
"SEF_URL_TEMPLATES" => array(
"sections" => "",
"section" => "#SECTION_CODE_PATH#/",
"element" => "#SECTION_CODE_PATH#/#ELEMENT_CODE#/",
"smart_filter" => "#SECTION_CODE_PATH#/filter/#SMART_FILTER_PATH#/",
),
if (isset($iOstatok)) {
if ($iOstatok > 0) {
$el = new CIBlockElement;
/*активировать, если деактивирована*/
if ($ar_res["ACTIVE"] == "N") {
/*активировать*/
$arLoadProductArray = Array(
"IBLOCK_SECTION_ID" => false,
"IBLOCK_ID" => $iBlock,
"ACTIVE" => "Y"
);
$el->Update($iElementID, $arLoadProductArray);
}
Cmodule::IncludeModule('catalog');
$arFields = array("QUANTITY" => $iOstatok);
CCatalogProduct::Update($iElementID, $arFields);
//$el->SetPropertyValues($iElementID, $iBlock, $iOstatok, "QUANTITY");
/*обновление остатков*/
} else {
/*обновление остатков*/
Cmodule::IncludeModule('catalog');
$el = new CIBlockElement;
$arFields = array("QUANTITY" => $iOstatok);
CCatalogProduct::Update($iElementID, $arFields);
}
}
$result = Sale\Internals\BasketTable::getList(array(
'filter' => array(
'FUSER_ID' => Sale\Fuser::getId(),
'ORDER_ID' => null,
'LID' => SITE_ID,
'CAN_BUY' => 'Y',
),
'select' => array('BASKET_COUNT', 'BASKET_SUM'),
'runtime' => array(
new \Bitrix\Main\Entity\ExpressionField('BASKET_COUNT', 'COUNT(*)'),
new \Bitrix\Main\Entity\ExpressionField('BASKET_SUM', 'SUM(PRICE*QUANTITY)'),
)
))->fetch();
<input type="text" value="Моё отдельное поле">
$order = \Bitrix\Sale\Order::load(123); //загрузим номер созданного заказа
$collection = $order->getPropertyCollection();
$propertyValue = $collection->getItemById(10);//id свойства
$r = $propertyValue->setField('VALUE', 'Моё отдельное поле');
if (!$r->isSuccess())
{
var_dump($r->getErrorMessages());
}
$order->save();
<!--мой код для вывода скидки-->
<p>Скидка 5% <span class="bxr-market-current-price bxr-market-format-price ">53<sup>20</sup> руб</span></p>
<p>Скидка 10% <span class="bxr-market-current-price bxr-market-format-price ">50<sup>40</sup> руб</span></p>
<p>Скидка 15% <span class="bxr-market-current-price bxr-market-format-price ">47<sup>60</sup> руб</span></p>
<p>Скидка 20% <span class="bxr-market-current-price bxr-market-format-price ">44<sup>80</sup> руб</span></p>
<!--мой код для вывода скидки-->