order = $order; $this->preOrderDeduction = $preOrderDeduction; parent::__construct($weight); } function getKey() { return $this->preOrderDeduction->getCode() . 'RestDeduction'; } /** * @return mixed * @throws \app\common\exceptions\AppException */ function getPrice() { if (!$this->preOrderDeduction->isChecked()) { return $this->order->getPriceBefore($this->getKey()); } else { return $this->order->getPriceBefore($this->getKey()) - $this->preOrderDeduction->getUsablePoint()->getMoney(); } } }