Answer the question
In order to leave comments, you need to log in
How to change the mass value of the SUBSCRIBE field?
I try it didn't work. where is the mistake ?
/* для поменл значения свойств в товаре */
function copy_from_fields_to_propertys_values($IBLOCK_ID){
if ( CModule::IncludeModule ( "iblock" ) ){
$arOrder = array(
"sort" => "ASC",
);
$arFilter = array(
"IBLOCK_ID" => $IBLOCK_ID,
);
$arSelect = array(
"NAME",
"ID",
'SUBSCRIBE' );
$db_elemens = CIBlockElement::GetList ( $arOrder, $arFilter, false, false, $arSelect );
while ( $arElement = $db_elemens->GetNextElement() ) {
$el = new CIBlockElement;
$filds = $arElement->GetFields();
print_r($filds['ID']);
echo"</br>";
echo"</br>";
$arLoadProductArray = Array(
"SUBSCRIBE" => "Y"
);
$res = $el->Update($filds['ID'], $arLoadProductArray);
}
} else {
die( "Модуль iblock не установлен" );
}
}
copy_from_fields_to_propertys_values('33')
;Answer the question
In order to leave comments, you need to log in
method , below there is an example with SUBSCRIBE (only this is a static method):
D - by default, from the module settings
Y
- yes
N - no
UPD
still in the source code it is written that the method is deprecated, use
\Bitrix\Catalog\Model\Product::update($id, ['SUBSCRIBE' => 'Y']);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question