How to override comment filed in system.xml in magento2?

by Rutvee Sojitra   Last Updated September 07, 2018 06:09 AM

I have override system.xml

My label is overridden but comment is not overridden. it's still take from core file

Core system.xml file code

<?xml version="1.0"?>
  <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Magento/Config/etc/system_file.xsd">
<system>
    <tab id="lsc" translate="label" sortOrder="100">
        <label>SLI Systems LSC</label>
    </tab>
    <section id="sli_feed_generation" translate="label" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
        <class>separator-top</class>
        <label>Feed Generation</label>
        <tab>lsc</tab>
        <resource>Sli_Feed::config_feed</resource>

        <group id="general" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>General</label>
            <field id="enabled" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Enabled</label>
                <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
            </field>
            <field id="log_level" translate="label comment" type="select" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Log Level</label>
                <comment>Please set to "Debug" if SLI support is required.</comment>
                <source_model>SLI\Feed\Model\Config\Source\Log</source_model>
            </field>
            <field id="version" translate="label" type="label" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Version</label>
                <frontend_model>SLI\Feed\Block\System\Config\Version</frontend_model>
            </field>
        </group>

        <group id="feed" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Feed Settings</label>
            <field id="advanced_pricing" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Advanced Pricing</label>
                <comment>Enable if need advanced prices from: Catalog Price Rules, Group or Tiered Pricing.</comment>
                <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
            </field>
            <field id="include_out_of_stock" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Include Out of Stock Items</label>
                <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
            </field>
            <field id="generate" translate="label comment" type="button" sortOrder="2" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Generate Feed</label>
                <frontend_model>SLI\Feed\Block\System\Config\Generate</frontend_model>
                <comment>Manually generates feed. If FTP is enabled, also sends the feed.</comment>
            </field>
        </group>

        <group id="ftp" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>FTP Settings</label>
            <field id="enabled" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Enabled</label>
                <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
            </field>
            <field id="user" translate="label comment" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>FTP User</label>
                <comment>Provided by SLI.</comment>
                <depends>
                    <field id="enabled">1</field>
                </depends>
            </field>
            <field id="password" translate="label comment" type="obscure" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>FTP Password</label>
                <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
                <comment>Provided by SLI.</comment>
                <depends>
                    <field id="enabled">1</field>
                </depends>
            </field>
            <field id="host" translate="label comment" type="text" sortOrder="4" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>FTP Host</label>
                <comment>Provided by SLI.</comment>
                <depends>
                    <field id="enabled">1</field>
                </depends>
            </field>
            <field id="upload_path" translate="label comment" type="text" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>FTP Upload Path</label>
                <comment>Provided by SLI.</comment>
                <depends>
                    <field id="enabled">1</field>
                </depends>
            </field>
        </group>

        <group id="product" translate="label" type="select" sortOrder="4" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Product Attributes</label>
            <field id="attributes_select" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Attributes to include</label>

                <frontend_model>SLI\Feed\Block\System\Config\Form\Field\FeedAttributesConfig</frontend_model>
                <backend_model>Magento\Config\Model\Config\Backend\Serialized\ArraySerialized</backend_model>

                <comment>
                    <![CDATA[
                    The following attributes are automatically added to the feed: <br />
                    <ul style="margin-left: 2em;">
                        <li><small>attribute_set_id</small></li>
                        <li><small>categories</small></li>
                        <li><small>child_ids</small></li>
                        <li><small>created_at</small></li>
                        <li><small>entity_id</small></li>
                        <li><small>final_price</small></li>
                        <li><small>has_options</small></li>
                        <li><small>is_salable</small></li>
                        <li><small>is_virtual</small></li>
                        <li><small>max_price</small></li>
                        <li><small>min_price</small></li>
                        <li><small>minimal_price</small></li>
                        <li><small>name</small></li>
                        <li><small>price</small></li>
                        <li><small>special_from_date</small></li>
                        <li><small>special_price</small></li>
                        <li><small>special_to_date</small></li>
                        <li><small>request_path</small></li>
                        <li><small>required_options</small></li>
                        <li><small>sku</small></li>
                        <li><small>tax_class_id</small></li>
                        <li><small>tier_price</small></li>
                        <li><small>type_id</small></li>
                        <li><small>updated_at</small></li>
                        <li><small>url_key</small></li>
                        <li><small>visibility</small></li>
                        <li><small>image</small></li>
                    </ul>
                    ]]>
                </comment>
            </field>
        </group>
    </section>
</system>

my custom system.xml code

   <?xml version="1.0" encoding="UTF-8"?>

 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
    <section id="sli_feed_generation" >
        <group id="product">
            <label>Product Attributes AData</label>
            <field id="attributes_select" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                <comment>
                    <![CDATA[
                    The following attributes are automatically added to the feed: <br />
                    <ul style="margin-left: 2em;">
                        <li><small>attribute_set_id</small></li>
                        <li><small>categories</small></li>
                     </ul>
                    ]]>
                </comment>
            </field>
        </group>
    </section>
</system>



Related Questions




System Config page at backend is showing Blank page

Updated March 24, 2017 07:09 AM