I want to add a Multiselect under Stores -> Settings -> All Stores -> Store View
I've added a new Field:
\Test\StoreSwitcher\Block\Store.php
<?php
namespace Test\StoreSwitcher\Block;
class Store extends \Magento\Backend\Block\System\Store\Edit\Form\Store
{
protected function _prepareStoreFieldset(\Magento\Framework\Data\Form $form) {
.....
$storeSwitcherIds = $storeModel->getSwitcherIds();
$fieldset->addField(
'store_switcher_ids',
'multiselect',
[
'name' => 'switcher_ids',
'label' => __('Store Switcher'),
'value' => $storeSwitcherIds,
'values' => $this->getStores(),
'required' => false,
'disabled' => $storeModel->isReadOnly()
]
);
.....
My Problem is, if I select multiple values, switcher_ids has only one value.
I've checked Post Request and the error is already here. switcher_ids[] should have two values.
Does somebody know what is wrong?