Hello,
On the last coreshop version, multiselect filter doesn't seems to be correctly rendered for the structure of the options.
Here is a way to reproduce it:
-
on the product class, add a multiselect field named "multisection"

-
create an index

-
create a filter

-
create two products, one having "gamme1" and "gamme2" selected, and the other having "gamme2" and "gamme3" selected.
-
calling preparedCondition this way:
$page = $request->get('page', 0);
$defaultPerPage = 5;
$perPage = $request->get('perPage', $defaultPerPage);
$filter = $this->get('coreshop.repository.filter')->find(1); //Get Filter by ID 1
$filteredList = $this->get('coreshop.factory.filter.list')->createList($filter, $request->request);
$filteredList->setLocale($request->getLocale());
$filteredList->setVariantMode(\CoreShop\Component\Index\Listing\ListingInterface::VARIANT_MODE_HIDE);
$filteredList->load();
$currentFilter = $this->get('coreshop.filter.processor')->processConditions($filter, $filteredList, $request->query);
$preparedConditions = $this->get('coreshop.filter.processor')->prepareConditionsForRendering($filter, $filteredList, $currentFilter);
A dump of $preparedConditions returns:
1 => array:6 [▼
"type" => "multiselect"
"label" => "multisection"
"currentValues" => []
"values" => array:2 [▼
0 => array:2 [▼
"value" => ",gamme1,gamme2,"
"count" => "1"
]
1 => array:2 [▼
"value" => ",gamme3,gamme2,"
"count" => "1"
]
]
"fieldName" => "multisection"
"quantityUnit" => null
]
It should return the following values:
"values" => array:3 [▼
0 => array:2 [▼
"value" => "gamme1"
"count" => "1"
]
1 => array:2 [▼
"value" => "gamme2"
"count" => "2"
]
2 => array:2 [▼
"value" => "gamme3"
"count" => "1"
]
]
Here is a screenshoot of the rendering using the default twig template for multiselect:

It should be 3 checkbox... "gamme1", "gamme2" and "gamme3".
Thanks.
Hello,
On the last coreshop version, multiselect filter doesn't seems to be correctly rendered for the structure of the options.
Here is a way to reproduce it:
on the product class, add a multiselect field named "multisection"

create an index

create a filter

create two products, one having "gamme1" and "gamme2" selected, and the other having "gamme2" and "gamme3" selected.
calling preparedCondition this way:
A dump of $preparedConditions returns:
It should return the following values:
Here is a screenshoot of the rendering using the default twig template for multiselect:

It should be 3 checkbox... "gamme1", "gamme2" and "gamme3".
Thanks.