magento / magento/community-features

Visual Merchandiser should accept multi-select attributes

Open
#285 2 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Priority: P3
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.