Skip to content

Commit

Permalink
Merge pull request #1251 from mailchimp/Issue906
Browse files Browse the repository at this point in the history
closes #906
  • Loading branch information
gonzaloebiz authored Aug 5, 2021
2 parents a5ba8a8 + c59ddbf commit 8aaf3bd
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions app/code/community/Ebizmarts/MailChimp/Model/Api/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,6 @@ protected function _getPayloadData($order)
}

$data['currency_code'] = $order->getOrderCurrencyCode();
$data['order_total'] = $order->getGrandTotal();
$data['tax_total'] = $this->returnZeroIfNull($order->getTaxAmount());
$data['discount_total'] = abs($order->getDiscountAmount());
$data['shipping_total'] = $this->returnZeroIfNull($order->getShippingAmount());

if ($dataPromo !== null) {
$data['promos'] = $dataPromo;
Expand All @@ -385,6 +381,16 @@ protected function _getPayloadData($order)
if ($orderCancelDate) {
$data['cancelled_at_foreign'] = $orderCancelDate;
}
$data['order_total'] = 0;
$data['tax_total'] = 0;
$data['discount_total'] = 0;
$data['shipping_total'] = 0;
} else {
$data['order_total'] = $order->getGrandTotal();
$data['tax_total'] = $this->returnZeroIfNull($order->getTaxAmount());
$data['discount_total'] = abs($order->getDiscountAmount());
$data['shipping_total'] = $this->returnZeroIfNull($order->getShippingAmount());

}

return $data;
Expand Down

0 comments on commit 8aaf3bd

Please sign in to comment.