Skip to content

Commit 72eb75d

Browse files
committed
chore: correct pricing including tax
1 parent a7359f1 commit 72eb75d

File tree

1 file changed

+6
-6
lines changed
  • src/app/code/community/Zendesk/Zendesk/Helper

1 file changed

+6
-6
lines changed

src/app/code/community/Zendesk/Zendesk/Helper/Data.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -541,9 +541,9 @@ public function getOrderDetailBasic($order)
541541
'name' => $order->getStoreName()
542542
),
543543
'display_price' => array(
544-
'with_tax' => $this->formatPrice($order->getGrandTotal(), $currency),
545-
'without_tax' => $this->formatPrice($order->getGrandTotal() - $order->getTaxAmount(), $currency), // TODO: get without tax
546-
'tax' => $this->formatPrice($order->getTaxAmount(), $currency) // TODO: get tax
544+
'with_tax' => $this->formatPrice($order->getGrandTotal() + $order->getTaxAmount(), $currency),
545+
'without_tax' => $this->formatPrice($order->getGrandTotal(), $currency),
546+
'tax' => $this->formatPrice($order->getTaxAmount(), $currency)
547547
),
548548
'timestamps' => array(
549549
'created_at' => $order->getCreatedAt(),
@@ -565,7 +565,7 @@ public function getOrderDetailBasic($order)
565565
}
566566

567567
foreach($order->getItemsCollection(array(), true) as $item) {
568-
$itemWithTax = $item->getRowTotal();
568+
$itemWithoutTax = $item->getRowTotal();
569569
$itemTax = $item->getTaxAmount();
570570

571571
$productId = $item->getProductId();
@@ -583,8 +583,8 @@ public function getOrderDetailBasic($order)
583583
'refunded' => intval($item->getQtyRefunded()),
584584
'meta' => array(
585585
'display_price' => array(
586-
'with_tax' => $this->formatPrice($itemWithTax, $currency),
587-
'without_tax' => $this->formatPrice($itemWithTax - $itemTax, $currency),
586+
'with_tax' => $this->formatPrice($itemWithoutTax + $itemTax, $currency),
587+
'without_tax' => $this->formatPrice($itemWithoutTax, $currency),
588588
'tax' => $this->formatPrice($iitemTax, $currency)
589589
),
590590
'timestamps' => array(

0 commit comments

Comments
 (0)