瀏覽代碼

Correctif mineur

packProduct
Fabien Normand 3 年之前
父節點
當前提交
72d19deb6c
共有 2 個文件被更改,包括 13 次插入0 次删除
  1. +9
    -0
      Field/Filter/ProductCategoriesFilter.php
  2. +4
    -0
      Repository/Product/ProductCategoryStore.php

+ 9
- 0
Field/Filter/ProductCategoriesFilter.php 查看文件

@@ -33,6 +33,15 @@ class ProductCategoriesFilter extends AssociationFilter
'class' => 'select2 input-sm',
'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 查看文件

@@ -3,6 +3,7 @@
namespace Lc\CaracoleBundle\Repository\Product;

use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;
@@ -10,6 +11,7 @@ use Lc\SovBundle\Repository\RepositoryQueryInterface;
class ProductCategoryStore extends AbstractStore
{
use SectionStoreTrait;
use MerchantStoreTrait;

protected ProductCategoryRepositoryQuery $query;

@@ -26,7 +28,9 @@ class ProductCategoryStore extends AbstractStore

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


Loading…
取消
儲存