After all I found the solution. The cause of this error is simple. The discount amount stored by magento is signed, that means it has a negative sign. The file app/design/frontend/[yourfrontend]/[yourtheme]/template/checkout/total/default.phtml ( this is where the amount is written on screen) contains the following code:
<tr>
<th colspan="<?php echo $this->getColspan(); ?>" style="<?php echo $this->getTotal()->getStyle() ?>" class="a-right">
<?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?><strong><?php endif; ?>
<?php echo $this->escapeHtml($this->getTotal()->getTitle()); ?>
<?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?></strong><?php endif; ?>
</th>
<td style="<?php echo $this->getTotal()->getStyle() ?>" class="a-right">
<?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?><strong><?php endif; ?>
<?php echo $this->helper('checkout')->formatPrice($this->getTotal()->getValue()) ?>
<?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?></strong><?php endif; ?>
</td>
The problem is the formatPrice()
function, and the negative parameter. A simple solution is the abs()
php function. Change the line
<?php echo $this->helper('checkout')->formatPrice($this->getTotal()->getValue()) ?>
to
<?php echo $this->helper('checkout')->formatPrice(abs($this->getTotal()->getValue())) ?>
And here we go, the problem solved.
I hope that helps.