allow to display result or not if translation is present

This commit is contained in:
Manuel Raynaud
2013-07-04 18:47:20 +02:00
parent ca44544f84
commit abe6064955

View File

@@ -32,6 +32,7 @@ use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Log\Tlog;
use Thelia\Model\CategoryQuery;
use Thelia\Model\ConfigQuery;
use Thelia\Type\TypeCollection;
use Thelia\Type;
@@ -156,7 +157,10 @@ class Category extends BaseLoop
*
* @todo : verify here if we want results for row without translations.
*/
$search->joinWithI18n($this->request->getSession()->get('locale', 'en_US'), \Criteria::INNER_JOIN);
$search->joinWithI18n(
$this->request->getSession()->get('locale', 'en_US'),
(ConfigQuery::read("default_lang_without_translation", 1)) ? \Criteria::LEFT_JOIN : \Criteria::INNER_JOIN
);
$categories = $this->search($search, $pagination);