currency in product loop

This commit is contained in:
Etienne Roudeix
2013-09-10 12:22:58 +02:00
parent 8570251b88
commit 1971240fca

View File

@@ -307,7 +307,9 @@ class Product extends BaseI18nLoop
$minPriceJoin->addExplicitCondition(ProductSaleElementsTableMap::TABLE_NAME, 'ID', $joiningTable, ProductPriceTableMap::TABLE_NAME, 'PRODUCT_SALE_ELEMENTS_ID', 'global_price_data');
$minPriceJoin->setJoinType(Criteria::LEFT_JOIN);
$search->addJoinObject($minPriceJoin);
$currency = $this->request->getSession()->getCurrency();
$search->addJoinObject($minPriceJoin, 'min_price_join')
->addJoinCondition('min_price_join', '`global_price_data`.`currency_id` = ?', $currency, null, \PDO::PARAM_INT);
}
/*
@@ -339,6 +341,9 @@ class Product extends BaseI18nLoop
$search->withColumn('ROUND(MAX(' . implode(' OR ', $booleanMatchedPriceList) . '), 2)', 'real_highest_price');
$search->withColumn('ROUND(MIN(' . implode(' OR ', $booleanMatchedPriceList) . '), 2)', 'real_lowest_price');
$search->withColumn('ROUND(MAX(' . implode(' OR ', $booleanMatchedPriceList) . '), 2)', 'real_highest_price_default_currency');
$search->withColumn('ROUND(MIN(' . implode(' OR ', $booleanMatchedPriceList) . '), 2)', 'real_lowest_price_default_currency');
$current = $this->getCurrent();
@@ -502,6 +507,8 @@ class Product extends BaseI18nLoop
}
}
var_dump($search->toString());
/* perform search */
$products = $this->search($search, $pagination);