diff --git a/app/code/community/Algolia/Algoliasearch/Helper/Entity/Producthelper.php b/app/code/community/Algolia/Algoliasearch/Helper/Entity/Producthelper.php index 222755e3..44de8b86 100644 --- a/app/code/community/Algolia/Algoliasearch/Helper/Entity/Producthelper.php +++ b/app/code/community/Algolia/Algoliasearch/Helper/Entity/Producthelper.php @@ -528,21 +528,21 @@ protected function handlePrice(Mage_Catalog_Model_Product &$product, $sub_produc foreach ($fields as $field => $with_tax) { $customData[$field] = array(); + $field_price = (double) $taxHelper->getPrice($product, $product->getPrice(), $with_tax, null, null, null, $product->getStore(), null); + $field_special_price = (double) $taxHelper->getPrice($product, $product->getPriceModel()->getFinalPrice(1, $product), $with_tax, null, null, null, $product->getStore(), null); foreach ($currencies as $currency_code) { $customData[$field][$currency_code] = array(); - $price = (double) $taxHelper->getPrice($product, $product->getPrice(), $with_tax, null, null, null, $product->getStore(), null); - $price = $directoryHelper->currencyConvert($price, $baseCurrencyCode, $currency_code); + $price = $directoryHelper->currencyConvert($field_price, $baseCurrencyCode, $currency_code); $price += $weeeTaxAmount; + $special_price = $directoryHelper->currencyConvert($field_special_price, $baseCurrencyCode, $currency_code); + $special_price += $weeeTaxAmount; + $customData[$field][$currency_code]['default'] = $price; $customData[$field][$currency_code]['default_formated'] = $this->formatPrice($price, false, $currency_code); - $special_price = (double) $taxHelper->getPrice($product, $product->getFinalPrice(), $with_tax, null, null, null, $product->getStore(), null); - $special_price = $directoryHelper->currencyConvert($special_price, $baseCurrencyCode, $currency_code); - $special_price += $weeeTaxAmount; - if ($customer_groups_enabled) { // If fetch special price for groups