|
|
@@ -151,12 +151,14 @@ class OrderUtils |
|
|
|
|
|
|
|
foreach($orderShop->getOrderProducts() as $orderProduct) { |
|
|
|
if ($orderProduct->getProduct()->getId() == $orderProductAdd->getProduct()->getId() |
|
|
|
&& $this->priceUtils->getPrice($orderProduct) == $this->priceUtils->getPrice($orderProductAdd) |
|
|
|
&& (string) $this->priceUtils->getPrice($orderProduct) == (string) $this->priceUtils->getPrice($orderProductAdd) |
|
|
|
&& $this->compareOrderProductReductionCatalog($orderProduct->getOrderProductReductionCatalog(), $orderProductAdd->getOrderProductReductionCatalog())) { |
|
|
|
|
|
|
|
$updated = true; |
|
|
|
$orderProduct->setQuantityOrder($orderProduct->getQuantityOrder() + $orderProductAdd->getQuantityOrder()); |
|
|
|
$this->em->persist($orderProduct); |
|
|
|
$updated = true; |
|
|
|
|
|
|
|
break ; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -178,10 +180,13 @@ class OrderUtils |
|
|
|
|
|
|
|
public function compareOrderProductReductionCatalog($orderProductReductionCatalog1, $orderProductReductionCatalog2) |
|
|
|
{ |
|
|
|
return $orderProductReductionCatalog1 && $orderProductReductionCatalog2 |
|
|
|
&& $orderProductReductionCatalog1->getUnit() == $orderProductReductionCatalog2->getUnit() |
|
|
|
&& $orderProductReductionCatalog1->getValue() == $orderProductReductionCatalog2->getValue() |
|
|
|
&& $orderProductReductionCatalog1->getBehaviorTaxRate() == $orderProductReductionCatalog2->getBehaviorTaxRate() ; |
|
|
|
return (!$orderProductReductionCatalog1 && !$orderProductReductionCatalog2) |
|
|
|
|
|
|
|
|| ($orderProductReductionCatalog1 |
|
|
|
&& $orderProductReductionCatalog2 |
|
|
|
&& $orderProductReductionCatalog1->getUnit() == $orderProductReductionCatalog2->getUnit() |
|
|
|
&& (string) $orderProductReductionCatalog1->getValue() == (string) $orderProductReductionCatalog2->getValue() |
|
|
|
&& $orderProductReductionCatalog1->getBehaviorTaxRate() == $orderProductReductionCatalog2->getBehaviorTaxRate()) ; |
|
|
|
} |
|
|
|
|
|
|
|
public function countQuantities($orderShop) |