Parcourir la source

[Espace producteur] Accueil : correctif liste produits

refactoring
Guillaume il y a 1 an
Parent
révision
ab0cec6f98
3 fichiers modifiés avec 13 ajouts et 4 suppressions
  1. +1
    -1
      common/logic/Product/Product/Repository/ProductRepository.php
  2. +7
    -1
      common/logic/Product/ProductCategory/Repository/ProductCategoryRepository.php
  3. +5
    -2
      producer/controllers/SiteController.php

+ 1
- 1
common/logic/Product/Product/Repository/ProductRepository.php Voir le fichier

@@ -88,7 +88,7 @@ class ProductRepository extends AbstractRepository
{
return Product::find()
->andWhere([
'id_producer' => $productCategory->id_producer,
'id_producer' => $this->getProducerContext()->id,
'active' => true,
])
->andWhere(

+ 7
- 1
common/logic/Product/ProductCategory/Repository/ProductCategoryRepository.php Voir le fichier

@@ -31,7 +31,13 @@ class ProductCategoryRepository extends AbstractRepository

public function findProductCategories()
{
return ProductCategory::searchAll([], ['orderby' => 'product_category.position ASC']);
return ProductCategory::searchAll([
'id_producer' => $this->getProducerContext()->id
],
[
'orderby' => 'product_category.position ASC'
]
);
}

public function findProductCategoriesAsArray()

+ 5
- 2
producer/controllers/SiteController.php Voir le fichier

@@ -89,8 +89,11 @@ class SiteController extends ProducerBaseController
*/
public function actionIndex()
{
$productManager = $this->getProductManager();
$pointSaleManager = $this->getPointSaleManager();

$dataProviderPointsSale = new ActiveDataProvider([
'query' => $this->getPointSaleManager()->queryPointSalesPublic($this->getProducerCurrent()),
'query' => $pointSaleManager->queryPointSalesPublic($this->getProducerCurrent()),
'pagination' => [
'pageSize' => 50,
],
@@ -101,7 +104,7 @@ class SiteController extends ProducerBaseController
$dataProviderProductsByCategories = [];
foreach ($productCategoryArray as $productCategory) {
$dataProviderProductsByCategories[$productCategory->id] = new ActiveDataProvider([
'query' => $this->getProductManager()->queryProductsByProductCategory($productCategory),
'query' => $productManager->queryProductsByProductCategory($productCategory),
'pagination' => [
'pageSize' => 500,
],

Chargement…
Annuler
Enregistrer