0

I purchased an extension and I want to change the label of a field in the admin to say 'Delivery Cut off Time' instead of 'Cut off Time'. This field is represented in the system.xml file of the extension

File: Bss/OrderDeliveryDate/etc/adminhtml/system.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <tab id="bss" translate="label" sortOrder="300">
            <label>Bss Commerce</label>
        </tab>
        <section id="orderdeliverydate" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Order Delivery Date</label>
            <tab>bss</tab>
            <resource>Bss_OrderDeliveryDate::config_orderdeliverydate</resource>
            <group id="general" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>General</label>

                <field id="process_time" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Processing Time</label>
                    <comment><![CDATA[Delivery will be taken after(x) day(s) upon the date order(s) made.]]></comment>
                </field>

                <field id="cut_off_time" translate="label" type="time" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Cut Off Time</label>
                    <!-- <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> -->
                    <comment><![CDATA[If customers place order after this time the date when orders made will be counted as the following day.]]></comment>
                </field>
            </group>
        </section>
    </system>
</config>

I have gone ahead and created my own module to try to make this changes. MyVendor_MyModule. I created a system.xml file, but I am not sure what is the proper way to overwrite the label.

  • Just for title change we made custom module not best way. Custom Module use for enhance the magento functionality or extend functionality. Its simple change. Reason: Magento will compile this module each time when user visit any page url in store. – Sourav Jul 28 '16 at 2:01
1

if you want to do it via custom module then you just need to add following code in your namespace/modulename/etc/adminhtml/system.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <section id="orderdeliverydate" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
           <resource>Bss_OrderDeliveryDate::config_orderdeliverydate</resource>
            <group id="general" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
               <field id="cut_off_time" translate="label" type="time" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Delivery Cut off Time</label>
                </field>
            </group>
        </section>
    </system>
</config>
| improve this answer | |
  • Just for title change we made custom module not best way. Custom Module use for enhance the magento functionality or extend functionality. Its simple change. Reason: Magento will compile this module each time when user visit any page url in store. – Sourav Jul 28 '16 at 2:01
  • yeah, I agree but she did not mentioned that she created module just for the label update. I just mentioned the method to update the label its the developer's wish to create individual module or merge this code to any of existing custom module. – Ekta Puri Jul 28 '16 at 2:06
  • Read Question carefully. – Sourav Jul 28 '16 at 2:07
  • also its not good practice to directly update label in the existing plugin, because whenever the extension will be updated the changes will be overwritten, So we can make this change in any existing custom module – Ekta Puri Jul 28 '16 at 2:08
  • that's fine. I already said that I have mentioned the method to do the needful, and clearly mentioned that "if you want to do it via custom module" now its the existing custom module or new module its the developer's decision – Ekta Puri Jul 28 '16 at 2:10
0

Don't Need to create custom module for just change the title of system configuration.System.xml used to edit the title only.

| improve this answer | |

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.