From d6136c56d4e5d698a61c9c5515622d2aa3503403 Mon Sep 17 00:00:00 2001 From: Etienne Roudeix Date: Wed, 11 Sep 2013 09:20:58 +0200 Subject: [PATCH] pse loop currency --- .../Thelia/Core/Template/Loop/ProductSaleElements.php | 11 +++++++---- templates/default_save/product.html | 6 +++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php b/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php index f1bbb198d..9330a7e90 100755 --- a/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php +++ b/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php @@ -68,9 +68,9 @@ class ProductSaleElements extends BaseLoop new Argument( 'order', new TypeCollection( - new Type\EnumListType(array('alpha', 'alpha_reverse', 'attribute', 'attribute_reverse')) + new Type\EnumListType(array('min_price', 'max_price', 'promo', 'new', 'random')) ), - 'attribute' + 'random' ) ); } @@ -125,8 +125,11 @@ class ProductSaleElements extends BaseLoop $defaultCurrency = CurrencyQuery::create()->findOneByByDefault(1); $defaultCurrencySuffix = '_default_currency'; - $search->joinProductPrice('price', Criteria::INNER_JOIN); - //->addJoinCondition('price', ''); + $search->joinProductPrice('price', Criteria::INNER_JOIN) + ->addJoinCondition('price', '`price`.`currency_id` = ?', $currency->getId(), null, \PDO::PARAM_INT); + + $search->joinProductPrice('price' . $defaultCurrencySuffix, Criteria::INNER_JOIN) + ->addJoinCondition('price_default_currency', '`price' . $defaultCurrencySuffix . '`.`currency_id` = ?', $defaultCurrency->getId(), null, \PDO::PARAM_INT); $search->withColumn('`price`.CURRENCY_ID', 'price_CURRENCY_ID') ->withColumn('`price`.PRICE', 'price_PRICE') diff --git a/templates/default_save/product.html b/templates/default_save/product.html index f78b7e296..9d8dda432 100755 --- a/templates/default_save/product.html +++ b/templates/default_save/product.html @@ -1,3 +1,5 @@ +{include file="includes/header.html"} + Here you are : {navigate to="current"}
From : {navigate to="return_to"}
Index : {navigate to="index"}
@@ -87,4 +89,6 @@ Index : {navigate to="index"}
{elseloop rel="product"}

Produit introuvable !

-{/elseloop} \ No newline at end of file +{/elseloop} + +{include file="includes/footer.html"} \ No newline at end of file