magento / magento/community-features
Visual Merchandiser should accept multi-select attributes
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 46
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
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;
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in vendor/magento/module-visual-merchandiser/Model/Config/Source/AllowedAttributes.php and inspect toOptionArray(), especially the frontend_input filter. Confirm how removing or changing that exclusion affects the attribute options, then verify that multiselect attributes appear as selectable merchandising-rule values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100