• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/delivery/services/automatic.php
  • Класс: BitrixSaleDeliveryServicesAutomatic
  • Вызов: Automatic::getProfilesDefaultParams
public function getProfilesDefaultParams(array $fields = array())
{
	if(empty($this->handlerInitParams["PROFILES"]) || !is_array($this->handlerInitParams["PROFILES"]))
		return array();

	$result = array();

	foreach($this->handlerInitParams["PROFILES"] as $profId => $params)
	{
		if(empty($params["TITLE"]))
			continue;

		$result[] = array(
			"CODE" => $this->handlerInitParams["SID"].":".$profId,
			"PARENT_ID" => $this->id,
			"NAME" => $params["TITLE"],
			"ACTIVE" => $this->active ? "Y" : "N",
			"SORT" => $this->sort,
			"DESCRIPTION" => isset($params["DESCRIPTION"]) ? $params["DESCRIPTION"] : "",
			"CLASS_NAME" => 'BitrixSaleDeliveryServicesAutomaticProfile',
			"CURRENCY" => $this->currency,
			"XML_ID" => Manager::generateXmlId(),
			"CONFIG" => array(
				"MAIN" => array(
					"PROFILE_ID" => $profId,
					"MARGIN_VALUE" => 0,
					"MARGIN_TYPE" => "%"
				)
			)
		);
	}

	return $result;
}