/** * Add TaxClasses to Order Item * * @return void */ protected function addTaxClasses() { foreach ($this->cart->getTaxClasses() as $taxClass) { /** * @var \Extcode\Cart\Domain\Model\Cart\TaxClass $taxClass */ /** * @var \Extcode\Cart\Domain\Model\Order\TaxClass $orderTaxClass */ $orderTaxClass = new \Extcode\Cart\Domain\Model\Order\TaxClass($taxClass->getTitle(), $taxClass->getValue(), $taxClass->getCalc()); $orderTaxClass->setPid($this->storagePid); $this->taxClassRepository->add($orderTaxClass); $this->orderItem->addTaxClass($orderTaxClass); $this->taxClasses[$taxClass->getId()] = $orderTaxClass; } }