2

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.

enter image description here

0

2 Answers 2

1

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.

0

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>

Looks like: enter image description here

By default, the sort_order value is 1. You can check the following config file:

vendor/amzn/amazon-pay-module/etc/config.xml

1
  • Does not work. The sort order is getting shown but it does not apply the order.
    – Black
    Commented Jan 25, 2021 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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