• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/delivery/services/automatic.php
  • Класс: BitrixSaleDeliveryServicesAutomatic
  • Вызов: Automatic::__construct
public function __construct(array $initParams)
{
	parent::__construct($initParams);

	if(isset($this->config["MAIN"]["SID"]) && $this->config["MAIN"]["SID"] <> '')
	{
		$initedHandlers = self::getRegisteredHandlers("SID");

		if(!isset($initedHandlers[$this->config["MAIN"]["SID"]]))
		{
			throw new SystemException("Can't initialize service with code"".$this->config["MAIN"]["SID"].""");
		}

		$this->sid = $this->code = $this->config["MAIN"]["SID"];
		$this->handlerInitParams = $this->getHandlerInitParams($this->sid);

		if(!empty($this->handlerInitParams["TRACKING_CLASS_NAME"]))
			$this->setTrackingClass($this->handlerInitParams["TRACKING_CLASS_NAME"]);

		if($this->handlerInitParams == false)
			throw new SystemException("Can't get delivery services init params. Delivery id: ".$this->id.", sid: ".$this->sid);

		if($this->currency == '' && !empty($this->handlerInitParams["BASE_CURRENCY"]))
			$this->currency = $this->handlerInitParams["BASE_CURRENCY"];
	}

	$initParams = self::convertNewServiceToOld($initParams, $this->sid);

	if(isset($initParams["CONFIG"]))
		$this->oldConfig = $initParams["CONFIG"];
}