Create a file named app/local/AHT/Acatalog/Block/Product/List.php to overwrite the block of Mage_Catalog_Block_Product_List with the following content:
<?php
classAHT_Acatalog_Block_Product_List extends Mage_Catalog_Block_Product_List {
public function getPriceJsonConfig($product) {
$config = array();
if (!$product->getTypeInstance(true)->hasOptions($product)) {
return Mage::helper('core')->jsonEncode($config);
}
$_request = Mage::getSingleton('tax/calculation')->getDefaultRateRequest();
$_request->setProductClassId($product->getTaxClassId());
$defaultTax = Mage::getSingleton('tax/calculation')->getRate($_request);
$_request = Mage::getSingleton('tax/calculation')->getRateRequest();
$_request->setProductClassId($product->getTaxClassId());
$currentTax = Mage::getSingleton('tax/calculation')->getRate($_request);
$_regularPrice = $product->getPrice();
$_finalPrice = $product->getFinalPrice();
if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE) {
$_priceInclTax = Mage::helper('tax')->getPrice($product, $_finalPrice, true, null, null, null, null, null, false);
$_priceExclTax = Mage::helper('tax')->getPrice($product, $_finalPrice, false, null, null, null, null, null, false);
} else {
$_priceInclTax = Mage::helper('tax')->getPrice($product, $_finalPrice, true);
$_priceExclTax = Mage::helper('tax')->getPrice($product, $_finalPrice);
}
$_tierPrices = array();
$_tierPricesInclTax = array();
foreach ($product->getTierPrice() as $tierPrice) {
$_tierPrices[] = Mage::helper('core')->currency(
Mage::helper('tax')->getPrice($product, (float) $tierPrice['website_price'], false) - $_priceExclTax
, false, false);
$_tierPricesInclTax[] = Mage::helper('core')->currency(
Mage::helper('tax')->getPrice($product, (float) $tierPrice['website_price'], true) - $_priceInclTax
, false, false);
}
$config = array(
'productId' => $product->getId(),
'priceFormat' => Mage::app()->getLocale()->getJsPriceFormat(),
'includeTax' => Mage::helper('tax')->priceIncludesTax() ? 'true' : 'false',
'showdIncludeTax' => Mage::helper('tax')->displayPriceIncludingTax(),
'showBothPrices' => Mage::helper('tax')->displayBothPrices(),
'productPrice' => Mage::helper('core')->currency($_finalPrice, false, false),
'productOldPrice' => Mage::helper('core')->currency($_regularPrice, false, false),
'priceInclTax' => Mage::helper('core')->currency($_priceInclTax, false, false),
'priceExclTax' => Mage::helper('core')->currency($_priceExclTax, false, false),
/**
* @varskipCalculate
* @deprecated after 1.5.1.0
*/
'skipCalculate' => ($_priceExclTax != $_priceInclTax ? 0 : 1),
'defaultTax' => $defaultTax,
'currentTax' => $currentTax,
'idSuffix' => '_clone',
'oldPlusDisposition' => 0,
'plusDisposition' => 0,
'plusDispositionTax' => 0,
'oldMinusDisposition' => 0,
'minusDisposition' => 0,
'tierPrices' => $_tierPrices,
'tierPricesInclTax' => $_tierPricesInclTax,
);
$responseObject = new Varien_Object();
Mage::dispatchEvent('catalog_product_view_config', array('response_object' => $responseObject));
if (is_array($responseObject->getAdditionalOptions())) {
foreach ($responseObject->getAdditionalOptions() as $option => $value) {
$config[$option] = $value;
}
}
return Mage::helper('core')->jsonEncode($config);
}
public function getViewTypeConfigurableBlock($product) {
$block = new Mage_Catalog_Block_Product_View_Type_Configurable();
$block->setData('product', $product);
return $block;
}
}