I want to change the sort order of the Amazon payment method.
By default, it comes to the first place. I need to display it in third place.
You have to create a custom extension and add extend the config with this system.xml:
app/code/Your/Extension/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="payment">
<group id="amazon_payment" translate="label" type="text" sortOrder="8" showInDefault="1" showInWebsite="1" showInStore="1">
<group id="options" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="sort_order" translate="label comment" type="text" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Sort Order</label>
<comment><![CDATA[Sort order of Amazon Pay in the list of payment methods during the final step of checkout.]]></comment>
<frontend_class>validate-number</frontend_class>
<config_path>payment/amazonlogin/sort_order</config_path>
<depends>
<field id="amazonloggin">1</field>
</depends>
</field>
</group>
</group>
</section>
</system>
</config>
Flush the cache and reload, the option should now be visible.
Add the following system config, so that you can able to edit sort order from admin.
app/code/SR/MagentoCommunity/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="payment">
<group id="amazon_payment" translate="label" type="text" sortOrder="8" showInDefault="1" showInWebsite="1" showInStore="1">
<group id="options" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="sort_order" translate="label" type="text" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Sort Order</label>
<frontend_class>validate-number</frontend_class>
<config_path>payment/amazon_payment/sort_order</config_path>
</field>
</group>
</group>
</section>
</system>
</config>
By default, the sort_order value is 1. You can check the following config file:
vendor/amzn/amazon-pay-module/etc/config.xml