Browse Source

Correctif mineur

packProduct
Fabien Normand 3 years ago
parent
commit
72d19deb6c
2 changed files with 13 additions and 0 deletions
  1. +9
    -0
      Field/Filter/ProductCategoriesFilter.php
  2. +4
    -0
      Repository/Product/ProductCategoryStore.php

+ 9
- 0
Field/Filter/ProductCategoriesFilter.php View File

'class' => 'select2 input-sm', 'class' => 'select2 input-sm',
'form' => 'filters-form', 'form' => 'filters-form',
), ),
'choice_label' => function ($category) {
$isOffline = '';
if ($category->getStatus() != 1) {
$isOffline = " [Hors ligne]";
}
$section = ' ['.$category->getSection()->getTitle().']' ;;
return $category->getTitle() . $section. $isOffline;

}
) )
); );
} }

+ 4
- 0
Repository/Product/ProductCategoryStore.php View File

namespace Lc\CaracoleBundle\Repository\Product; namespace Lc\CaracoleBundle\Repository\Product;


use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface; use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Repository\SectionStoreTrait; use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\CaracoleBundle\Repository\AbstractStore; use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface; use Lc\SovBundle\Repository\RepositoryQueryInterface;
class ProductCategoryStore extends AbstractStore class ProductCategoryStore extends AbstractStore
{ {
use SectionStoreTrait; use SectionStoreTrait;
use MerchantStoreTrait;


protected ProductCategoryRepositoryQuery $query; protected ProductCategoryRepositoryQuery $query;




public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
{ {
$query->filterIsOnlineAndOffline();
$this->addFilterBySectionOptionnal($query); $this->addFilterBySectionOptionnal($query);
$this->addFilterByMerchantViaSectionOptionnal($query);
return $query; return $query;
} }



Loading…
Cancel
Save