Permalink
Browse files

updated orderpricing

  • Loading branch information...
1 parent e4ad35e commit 9f284c35d238fea18e2c3804b868de1b7183d30e @theodorDiaconu theodorDiaconu committed with iampersistent Jan 24, 2013
Showing with 4 additions and 6 deletions.
  1. +4 −6 lib/ImmersiveLabs/Pricing/Provider/OrderPricingProvider.php
View
10 lib/ImmersiveLabs/Pricing/Provider/OrderPricingProvider.php
@@ -44,20 +44,19 @@ public function determineOrderPrices(OrderInterface $order, PricingContextInterf
// updating prices for each item
foreach ($order->getItems() as $item) {
/** @var ItemInterface $item */
- $pricing = $item->getPricing();
- $itemsTotalNet += $pricing->getTotalValue();
+ $itemsTotalNet += $item->getPricing()->getNetValue();
}
- $orderPricingSet->set('totalValue', $itemsTotalNet);
+ $orderPricingSet->set('totalNet', $itemsTotalNet);
// if pricing context has taxation enabled we calculate the taxes with the percentage set
// example taxRates : 0.10 for 10%, 0.25 for 25%
if ($state = $pricingContext->get('address.state')) {
$rate = $this->taxProvider->getTaxByState($state);
$totalTax = $itemsTotalNet * $rate;
$orderPricingSet->set('taxRate', $rate);
- $orderPricingSet->set('totalTax', $totalTax);
- $orderPricingSet->set('totalGross', $itemsTotalNet + $totalTax);
+ $orderPricingSet->set('taxes', $totalTax);
+ $orderPricingSet->set('totalValue', $itemsTotalNet + $totalTax);
}
$orderPricingSet->setProcessingState(PricingSet::PROCESSING_FINISHED);
@@ -78,7 +77,6 @@ function determineOrderItemPrices(ItemInterface $item, PricingContextInterface $
{
$productPricing = $item->getProduct()->getPricing();
$itemPricing = $productPricing->process($pricingContext);
-
$item->setPricing($itemPricing);
}
}

0 comments on commit 9f284c3

Please sign in to comment.