Skip to content

Commit

Permalink
Merge pull request #1926 from mailchimp/Issue1921-2.1
Browse files Browse the repository at this point in the history
closes #1921 for magento 2.1
  • Loading branch information
gonzaloebiz authored Mar 18, 2024
2 parents 7ec1cc3 + b946c43 commit c14928e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Model/Api/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ protected function GeneratePOSTPayload(\Magento\Sales\Model\Order $order, $mailc
} else {
$data['order_total'] = $order->getGrandTotal();
$data['tax_total'] = $order->getTaxAmount();
$data['discount_total'] = abs($order->getDiscountAmount());
$data['discount_total'] =$order->getDiscountAmount() ? abs($order->getDiscountAmount()) : 0;
$data['shipping_total'] = $order->getShippingAmount();
}

Expand Down Expand Up @@ -452,7 +452,7 @@ protected function GeneratePOSTPayload(\Magento\Sales\Model\Order $order, $mailc
"product_variant_id" => $variant,
"quantity" => (int)$item->getQtyOrdered(),
"price" => $item->getPrice(),
"discount" => abs($item->getDiscountAmount())
"discount" => $item->getDiscountAmount() ? abs($item->getDiscountAmount()) : 0
];
}
}
Expand Down Expand Up @@ -718,7 +718,7 @@ protected function _getPromoData(\Magento\Sales\Model\Order $order)
if ($code->getCouponId() !== null) {
$rule = $this->ruleRepository->getById($code->getRuleId());
if ($rule->getRuleId() !== null) {
$amountDiscounted = $order->getBaseDiscountAmount();
$amountDiscounted = $order->getBaseDiscountAmount() ? $order->getBaseDiscountAmount() : 0;
$type = $rule->getSimpleAction();
if ($type == 'by_percent') {
$type = 'percentage';
Expand Down

0 comments on commit c14928e

Please sign in to comment.