entityManager = $entityManager; $this->priceSolver = $priceSolver; $this->orderProductStore = $orderProductStore; $this->productSolver = $productSolver; $this->orderProductSolver = $orderProductSolver; $this->productFamilySolver = $productFamilySolver; $this->orderProductReductionCatalogFactory = $orderProductReductionCatalogFactory; $this->productFamilyStore = $productFamilyStore; } public function init(OrderProductInterface $orderProduct) :OrderProductInterface { $orderProduct->setTitle($this->orderProductSolver->getTitleOrderShop($orderProduct)); $orderProduct->setPrice($this->priceSolver->getPrice($orderProduct->getProduct())); // #402 //$orderProduct->setPrice($this->priceSolver->getPriceWithReduction($orderProduct->getProduct())); $orderProduct->setBuyingPrice($this->priceSolver->getBuyingPrice($orderProduct->getProduct())); $orderProduct->setUnit($this->productSolver->getUnitInherited($orderProduct->getProduct())); $orderProduct->setTaxRate($this->productFamilySolver->getTaxRateInherited($orderProduct->getProduct())); $orderProduct->setQuantityProduct($this->productSolver->getQuantityInherited($orderProduct->getProduct())); return $orderProduct; } public function initReductionCatalog(SectionInterface $section, OrderProductInterface $orderProduct, ProductFamilyInterface $productFamily): OrderProductInterface { if(!$orderProduct->getOrderProductReductionCatalog()) { $reductionCatalog = $productFamily->getReductionCatalog(); if ($reductionCatalog && $reductionCatalog->getStatus()) { $orderProductReductionCatalog = $this->orderProductReductionCatalogFactory->create( $reductionCatalog->getTitle(), is_null($reductionCatalog->getValue()) ? 0 : $reductionCatalog->getValue(), $reductionCatalog->getUnit(), $reductionCatalog->getBehaviorTaxRate() ); $orderProduct->setOrderProductReductionCatalog($orderProductReductionCatalog); } } return $orderProduct; } }