diff --git a/core/lib/Thelia/Core/Template/Loop/Product.php b/core/lib/Thelia/Core/Template/Loop/Product.php
index e7d1cf8a3..76ffda24b 100755
--- a/core/lib/Thelia/Core/Template/Loop/Product.php
+++ b/core/lib/Thelia/Core/Template/Loop/Product.php
@@ -86,6 +86,7 @@ class Product extends BaseI18nLoop
Argument::createBooleanTypeArgument('current_category'),
Argument::createIntTypeArgument('depth', 1),
Argument::createBooleanOrBothTypeArgument('visible', 1),
+ Argument::createIntTypeArgument('currency'),
new Argument(
'order',
new TypeCollection(
@@ -136,7 +137,16 @@ class Product extends BaseI18nLoop
*/
public function exec(&$pagination)
{
- $currency = $this->request->getSession()->getCurrency();
+ $currencyId = $this->getCurrency();
+ if(null !== $currencyId) {
+ $currency = CurrencyQuery::create()->findOneById($currencyId);
+ if(null === $currency) {
+ throw new \InvalidArgumentException('Cannot found currency id: `' . $currency . '` in product_sale_elements loop');
+ }
+ } else {
+ $currency = $this->request->getSession()->getCurrency();
+ }
+
$defaultCurrency = CurrencyQuery::create()->findOneByByDefault(1);
$defaultCurrencySuffix = '_default_currency';
diff --git a/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php b/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php
index 38d4d2e94..3b89eedca 100755
--- a/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php
+++ b/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php
@@ -82,6 +82,7 @@ class ProductSaleElements extends BaseLoop
* @param $pagination
*
* @return \Thelia\Core\Template\Element\LoopResult
+ * @throws \InvalidArgumentException
*/
public function exec(&$pagination)
{
@@ -115,7 +116,7 @@ class ProductSaleElements extends BaseLoop
}
$currencyId = $this->getCurrency();
- if(null !== $currency) {
+ if(null !== $currencyId) {
$currency = CurrencyQuery::create()->findOneById($currencyId);
if(null === $currency) {
throw new \InvalidArgumentException('Cannot found currency id: `' . $currency . '` in product_sale_elements loop');
diff --git a/templates/default_save/product.html b/templates/default_save/product.html
index 55de8362d..f78b7e296 100755
--- a/templates/default_save/product.html
+++ b/templates/default_save/product.html
@@ -6,7 +6,7 @@ Index : {navigate to="index"}
{ifloop rel="product"}
-{loop type="product" name="product" current="true"}
+{loop type="product" name="product" current="true" min_price="50" max_price="100"}