1

I have override system.xml file.

My label is overridden but comment field is not overridden. It's still take from core file. Any help should be appreciated. Thanks.

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>

please see: enter image description here

module.xml

 <?xml version="1.0"?>
  <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Tatva_SLIFeed" setup_version="0.0.1">
    <sequence>
        <module name="SLI_Feed" />
    </sequence>
</module>

0

Vendor/ModuleName/etc/adminhtml/system.xml

<?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>

Vendor/ModuleName/etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_YourModule" setup_version="1.0.0">
<sequence>
<module name="Core_ModuleName"/>
</sequence>
</module>
</config>

Note : Core_ModuleName is overridden module name.

Hope, It will helpful for you.

  • What you suggest is i have already tried. it's not working for comment field If i am changing label it worked!!! – Rutvee Sojitra Sep 7 '18 at 7:00
  • I use your comment in my code and test. It's update successfully. Remove var & generated folder and check it. – Rohan Hapani Sep 7 '18 at 7:23
  • I have added screenshot please check I have removed all cache folder and generated folder – Rutvee Sojitra Sep 7 '18 at 8:16
  • what is your magento version? – Rohan Hapani Sep 7 '18 at 8:55
  • And please make sure that in module.xml this is correct or not. <module name="Sli_Feed"/> – Rohan Hapani Sep 7 '18 at 8:56

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.