diff --git a/src/Eccube/Repository/ProductRepository.php b/src/Eccube/Repository/ProductRepository.php index 768e6a7374e..922c42b2c76 100644 --- a/src/Eccube/Repository/ProductRepository.php +++ b/src/Eccube/Repository/ProductRepository.php @@ -132,6 +132,7 @@ public function getQueryBuilderBySearchData($searchData) //@see http://doctrine-orm.readthedocs.org/en/latest/reference/dql-doctrine-query-language.html $qb->addSelect('MIN(pc.price02) as HIDDEN price02_min'); $qb->innerJoin('p.ProductClasses', 'pc'); + $qb->andWhere('pc.visible = true'); $qb->groupBy('p.id'); $qb->orderBy('price02_min', 'ASC'); $qb->addOrderBy('p.id', 'DESC'); @@ -139,6 +140,7 @@ public function getQueryBuilderBySearchData($searchData) } elseif (!empty($searchData['orderby']) && $searchData['orderby']->getId() == $config['eccube_product_order_price_higher']) { $qb->addSelect('MAX(pc.price02) as HIDDEN price02_max'); $qb->innerJoin('p.ProductClasses', 'pc'); + $qb->andWhere('pc.visible = true'); $qb->groupBy('p.id'); $qb->orderBy('price02_max', 'DESC'); $qb->addOrderBy('p.id', 'DESC'); @@ -148,6 +150,7 @@ public function getQueryBuilderBySearchData($searchData) // @see https://github.com/EC-CUBE/ec-cube/issues/1998 if ($this->getEntityManager()->getFilters()->isEnabled('option_nostock_hidden') == true) { $qb->innerJoin('p.ProductClasses', 'pc'); + $qb->andWhere('pc.visible = true'); } $qb->orderBy('p.create_date', 'DESC'); $qb->addOrderBy('p.id', 'DESC');