Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -505,13 +505,6 @@ protected function handlePrice(Mage_Catalog_Model_Product &$product, $sub_produc
$directoryCurrency = Mage::getModel('directory/currency');
$currencies = $directoryCurrency->getConfigAllowCurrencies();

if (Mage::helper('core')->isModuleEnabled('Mage_Weee') &&
Mage::helper('weee')->getPriceDisplayType($product->getStore()) == 0) {
$weeeTaxAmount = Mage::helper('weee')->getAmountForDisplay($product);
} else {
$weeeTaxAmount = 0;
}

$baseCurrencyCode = $store->getBaseCurrencyCode();

$groups = array();
Expand All @@ -533,6 +526,8 @@ protected function handlePrice(Mage_Catalog_Model_Product &$product, $sub_produc
$customData[$field][$currency_code] = array();

$price = (double) $taxHelper->getPrice($product, $product->getPrice(), $with_tax, null, null, null, $product->getStore(), null);

$weeeTaxAmount = $this->getWeeeAmount($product, $with_tax);
$price = $directoryHelper->currencyConvert($price, $baseCurrencyCode, $currency_code);
$price += $weeeTaxAmount;

Expand Down Expand Up @@ -1112,7 +1107,7 @@ private function getCompositeTypes()

return $this->compositeTypes;
}

public function getAllProductIds($storeId)
{
$products = Mage::getModel('catalog/product')->getCollection();
Expand Down Expand Up @@ -1313,4 +1308,19 @@ private function clearFacetsQueryRules($index)
}
}
}

private function getWeeeAmount($product, $withTax)
{
// Get the weee tax amount if the weee module is enabled and for all types that include it
if (
!Mage::helper('core')->isModuleEnabled('Mage_Weee') ||
!Mage::helper('weee')->typeOfDisplay($product, [0, 1, 4])
) {
return 0;
}

return $withTax
? Mage::helper('weee')->getAmountForDisplayInclTaxes($product)
: Mage::helper('weee')->getAmountForDisplay($product);
}
}