Created
September 16, 2018 13:39
-
-
Save imbolc/1c5cfa041c52386395a65a3cc3ded0bb to your computer and use it in GitHub Desktop.
Reorder Shopify payment gateways
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sort_gateways(order) | |
Output.payment_gateways = Input.payment_gateways.sort_by do |gateway| | |
# sometimes name isn't equal the title you see in payment page | |
# puts gateway.name | |
order.index(gateway.name) || 99 | |
end | |
end | |
sort_gateways([ | |
'Credit and Debit Cards', | |
'PayPal Express Checkout', | |
'Bank transfer (Mollie)', | |
'Bancontact via Mollie', | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment