Magento – plus. 0% VAT. – Problem after installation of Market Ready Germany 2

It happened suddenly, that the store only plus. 0% VAT. was shown. This seems like a problem with the extension Market Ready Germany 2 to be, although I would like to save the conjecture here and am relying solely on observations of other users. This contribution brought the solution:

I have the Tax.php (app/code/community/Symmetrics/TweaksGerman/Block) adapted by Symmetrics, which in my opinion, still contains an error.
In the class Mage_Tax_Helper_Data intercepted in one place, wenn null bei getTaxPercent() returns. This is the case when front end price and back end are the same price (almost alles Net Preise). In this case, it is at MRG Sun, that there will also “null” returns, which cast int to give 0 is, and therefore 0 % VAT.
In the class, however, brought Mage_Tax_Helper_Data manually in such a case, the tax rate of the product deposited tax bracket. To retrofit this in MRG I have the method _getTaxInfo() the adjusted Tax.php. Code shown below:

protected static function _getTaxInfo($product)
{
$tax = Mage::helper('tax');
if ($product->getTypeId() == 'bundle') {
// bundle product type has not tax percent
if ($tax->displayPriceIncludingTax()) {
$taxInfo = Mage::helper('tweaksgerman')->__('Incl. tax');
} else {
$taxInfo = Mage::helper('tweaksgerman')->__('Excl. tax');
}
} else {
$taxPercent = $product->getTaxPercent();

// ch / Adaptation thus also, All prices are net iff the control is found (Fix 0% VAT. although 19% deposited).
if (is_null($taxPercent)) { // 0% Control is taken over, Query accesses only to null.
$taxClassId = $product->getTaxClassId();
if ($taxClassId) {
$request = Mage::getSingleton('tax/calculation')->getRateRequest(null, null, null, null);
$taxPercent = Mage::getSingleton('tax/calculation')->getRate($request->setProductClassId($taxClassId));
}
}
// ch / END (see also Mage_Tax_Helper_Data)

if ($tax->displayPriceIncludingTax()) {
$taxInfo = sprintf(Magus::helper('tweaksgerman')->__('Incl. %1$s%% tax'), (int) $taxPercent);
} else {
$taxInfo = sprintf(Magus::helper('tweaksgerman')->__('Excl. %1$s%% tax'), (int) $taxPercent);
}
}

return $taxInfo;
}

Restated, the else branch in the comments // ch /….

Used in Magento 1.4.1.1

Published by Covos

Since 2009 I have been working intensively with Magento. I started with the creation and operation of B2C stores. This was extended through my work in the logistics sector. This resulted first specialized B2E systems. Today I work day-a day with exciting B2C, B2B- and B2E projects and reports in this blog about challenges and give insider tips.

2 comments on “Magento – plus. 0% VAT. – Problem after installation of Market Ready Germany 2”

Leave a Reply

Your email address will not be published. Required fields are marked *