setFeatures
\Bitrix\Main\Entity\Result public static \Bitrix\Iblock\Model\PropertyFeature::setFeatures( integer $propertyId, array $features );
Method sets property parameters. Static method.
Parameters
Parameter | Description | Version |
---|---|---|
$propertyId | Property identifier. | |
$features | List of parameters. |
Exceptions
- \Bitrix\Main\ArgumentException
- \Bitrix\Main\Db\SqlQueryException
- \Bitrix\Main\ObjectPropertyException
- \Bitrix\Main\SystemException
Example
/** * Adding a feature to a property */ public static function addFeatureToPropertyIblock(int $propId) { if(!$propId) return false; \Bitrix\Iblock\Model\PropertyFeature::setFeatures($propId, [ ["FEATURE_ID"=>"IN_BASKET", "IS_ENABLED" => "Y", "MODULE_ID" => "catalog"], ["FEATURE_ID"=>"OFFER_TREE", "IS_ENABLED" => "Y", "MODULE_ID" => "catalog"] ]); }
Please, be advised as follows:
- IN_BASKET - property added to shopping cart,
- OFFER_TREE - property participates in SKU selection (You cannot specify this to any property, but only to single list items, lists or binding to an element).
© «Bitrix24», 2001-2024