community-features
community-features copied to clipboard
Visual Merchandiser should accept multi-select attributes
In Magento 1 we were able to create merchandising rules to select a value from a Multi-select attribute. But, in Magento 2 the multi-select attributes are not selectable.
It seems like Magento 2 Devs removed this feature, but I am not sure why.
Please look at the following file:
vendor/magento/module-visual-merchandiser/Model/Config/Source/AllowedAttributes.php
public function toOptionArray()
{
$entityTypeId = $this->type->loadByCode(\Magento\Catalog\Model\Product::ENTITY)->getId();
if ($entityTypeId) {
$collection = $this->attribute->getCollection()
->removeAllFieldsFromSelect()
->addFieldToSelect('attribute_code', 'value')
->addFieldToSelect('frontend_label', 'label')
->addFieldToFilter('entity_type_id', ['eq' => $entityTypeId])
->addFieldToFilter('frontend_input', ['neq' => 'multiselect']); // <------------------------------ THIS LINE
$attributes = $collection->toArray();
if (isset($attributes['items'])) {
$this->options = $attributes['items'];
}
}
return $this->options;
}
Hi @imontaine. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.
Please, add a comment to assign the issue: @magento I am working on this
- Join Magento Community Engineering Slack and ask your questions in #github channel.
I would like this feature as well