Skip to content

Commit

Permalink
Merge pull request #25 from grininc/bug/TS-413/magento-string-discoun…
Browse files Browse the repository at this point in the history
…t-amount

TS-413: some plugins apparently are having the magento extension libr…
  • Loading branch information
grinlowejon authored Dec 11, 2023
2 parents d3eb14f + 7217eaf commit 4f14077
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Block/Checkout/Success.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ public function getOrderId(): string
public function getSubtotal()
{
$order = $this->getOrder();
return $order->getBaseSubtotal() - abs($order->getDiscountAmount() ?: 0);

// float added to type cast from string as some plugins were writing strings of the values.
return $order->getBaseSubtotal() - abs((float)$order->getDiscountAmount() ?: 0);
}
}

0 comments on commit 4f14077

Please sign in to comment.