|
|
@@ -2,6 +2,7 @@ |
|
|
|
|
|
|
|
namespace Lc\CaracoleBundle\Solver\Price; |
|
|
|
|
|
|
|
use Lc\CaracoleBundle\Model\Order\OrderProductInterface; |
|
|
|
use Lc\CaracoleBundle\Model\Order\OrderReductionCreditInterface; |
|
|
|
use Lc\CaracoleBundle\Model\Order\OrderShopInterface; |
|
|
|
use Lc\CaracoleBundle\Model\Reduction\ReductionCartModel; |
|
|
@@ -388,5 +389,20 @@ class OrderShopPriceSolver |
|
|
|
|
|
|
|
return $this->round($total); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public function getReductionPercent(OrderShopInterface $orderShop) |
|
|
|
{ |
|
|
|
$totalWithTax = $this->getTotalOrderProductsWithTax($orderShop); |
|
|
|
$totalReductionWithTax = $totalWithTax - $this->getTotalOrderProductsWithTaxAndReductions($orderShop); |
|
|
|
|
|
|
|
return -(($totalReductionWithTax * 100) / $totalWithTax); |
|
|
|
} |
|
|
|
|
|
|
|
public function getOrderProductTotalWithTaxAndReductionGlobal(OrderShopInterface $orderShop, OrderProductInterface $orderProduct) |
|
|
|
{ |
|
|
|
return $this->round($this->applyPercent( |
|
|
|
$this->orderProductPriceResolver->getTotalWithTaxAndReduction($orderProduct, false), |
|
|
|
$this->getReductionPercent($orderShop) |
|
|
|
)); |
|
|
|
} |
|
|
|
} |