I have a german B2C-online-shop. The product-prices that have been inserted in the backend are incl. 19% VAT. In the shop I have defined different taxrules that represents the following cases:
- If the customer is a private person (regardless of which country) or a company from germany, the price should be displayed incl. 19% VAT - .
- Example: price in backend is 10 € > displayed price should be "10 € incl. 19% VAT"
- If the customer is a company from an other country than germany, the price should be displayed incl. 0% VAT.
- Example: price in backend is 10 € > displayed price should be "8,4 € incl. 0% VAT"
The case 1 works without problems in the whole order-process - I think this is because it is the normal behavior of the Magento-shop.
The case 2 doesn't work properly. When I look in a category-page (with the product-list) or in the product-view the prices are displayed correct: 8,4 € incl. 0% VAT. In the shopping cart and in the checkout-process the prices are wrong: 10 € incl. 19% VAT. The tax for the shipping costs are also wrong (they are inserted with 19% VAT in backend and are displayed incl. 19% VAT - but it should display the shipping cost with 0% VAT in this case). The calculated totals works also with 19% VAT and display the calculated tax-amaount for 19% VAT.
The backend-configuration for the prices in the product-view, the cart and the checkout are identical (Including Tax). So this shouldn't be the problem.
I think the problem is, that Magento use the Mage_Sales_Model_Quote_Item to handle the articles and prices in the cart and checkout. In the product-list and product-view Magento uses the Mage_Catalog_Model_Product. It looks like Mage_Sales_Model_Quote_Item ignores the taxrules. I've tried to change the function getCalculationPriceOriginal() in Mage_Sales_Model_Quote_Item_Abstract to calculate the price with this code:
public function getCalculationPriceOriginal()
{
$_product = $this->getProduct();
$_taxHelper = Mage::helper('tax');
$_store = $_product->getStore();
$_convertedPrice = $_store->roundPrice($_store->convertPrice($_product->getPrice()));
$price = $_taxHelper->getPrice($_product, $_convertedPrice);
...
}
This helped to display the correct price in the product-listing in the shopping cart but the totals are still calculated wrong. Apart from that I think it is not a good idea to change the calculations in the core-classes because I don't know which side effects this has in the whole order-process and which functions I have to change.
So the question is: What can I do to display the correct prices for case 2 in the whole order-process?