0

I want to create a system config where you could tick the necessary weekdays, but this way:

<field id="days" translate="label" type="checkbox" sortOrder="11" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Days in the week</label>
                </field>

I only get one checkbox. Is there a way to have multiple checkboxes one below the other?

1 Answer 1

1

By using multiselect field type, you can achieve your requirement. Please see the below code:

 <field id="days" translate="label" type="multiselect" sortOrder="11" showInDefault="1" showInWebsite="0" showInStore="0">
      <label>Days in the week</label>
      <source_model>Magento\Config\Model\Config\Source\Locale\Weekdays</source_model>
 </field>
2
  • Maybe I wasn't specific enough. I want to be able to select multiple days. With your solution you can only select one. Jun 18, 2017 at 11:42
  • hold control and click to pick specific multiple days, hold shift to create a blanket monday to friday ect
    – John
    Apr 9, 2018 at 7:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.