1

I would like to add custom attribute for shipping method so that I can set it up in admin panel:

enter image description here

I know it should be done in Setup\InstallSchema.php, but what entity name shall I use instead of Product::Entity?

// Add our "features" attribute
    $eavSetup->addAttribute(Product::ENTITY, 'features', [
        'type' => 'text',
        'label' => 'Features',
        'input' => 'textarea',
        'required' => false,
        'sort_order' => 100,
        'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
        'wysiwyg_enabled' => true,
        'is_html_allowed_on_front' => true,
    ]);
0

Simply set it up in etc/adminhtml/system.xml:

<system>
    <section id="carriers" translate="label" type="text" sortOrder="320" showInDefault="1" showInWebsite="1" showInStore="1">
        <group id="gls" translate="label" type="text" sortOrder="0" showInDefault="1" showInWebsite="1" showInStore="1">


            <field id="YOUR CUSTOM FIELD ID" translate="label" type="textarea" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Label</label>
            </field> 


        </group>
    </section>
</system>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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