Codeschnipsel - Magento 1.7.0.2 - Rundungsfehler Fix
1. Rundungsfunktion in der Datei app/code/local/Mage/Core/Model/Store.php anpassen:
Code:public function roundPrice($price) { return round($price, 4); }
2. Da man an Paypal nur bis zu 2 Kommastellen übergeben kann, muss man ebenfalls die Schnittstelle anfassen:
Datei: app/code/core/Mage/Paypal/Model/Cart.php
Code:if ($this->_salesEntity instanceof Mage_Sales_Model_Order) { $shippingDescription = $this->_salesEntity->getShippingDescription(); $this->_totals = array( self::TOTAL_SUBTOTAL => round($this->_salesEntity->getBaseSubtotal(), 2), self::TOTAL_TAX => round($this->_salesEntity->getBaseTaxAmount(), 2), self::TOTAL_SHIPPING => round($this->_salesEntity->getBaseShippingAmount(), 2), self::TOTAL_DISCOUNT => round(abs($this->_salesEntity->getBaseDiscountAmount()), 2), ); $this->_applyHiddenTaxWorkaround($this->_salesEntity); } else { $address = $this->_salesEntity->getIsVirtual() ? $this->_salesEntity->getBillingAddress() : $this->_salesEntity->getShippingAddress(); $shippingDescription = $address->getShippingDescription(); $this->_totals = array ( self::TOTAL_SUBTOTAL => round($this->_salesEntity->getBaseSubtotal(), 2), self::TOTAL_TAX => round($address->getBaseTaxAmount(), 2), self::TOTAL_SHIPPING => round($address->getBaseShippingAmount(), 2), self::TOTAL_DISCOUNT => round(abs($address->getBaseDiscountAmount()), 2), ); $this->_applyHiddenTaxWorkaround($address); }
Viel Spaß beim Ausprobieren ;-)