Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Payment
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Feb 2011 at 15:19 UTC
Updated:
16 Feb 2011 at 21:00 UTC
Currently, payment methods in checkout pages aren't sorted in any particular way, I think we should respect the rules weight settings for payment rules.
I'm doing a pull request for this.
Comments
Comment #1
pcambraHere is the pull request
https://github.com/pcambra/drupalcommerce/commit/1ae0361993b73e2bb85c188...
If you commit this after the payment_methods to array one (#1044132: Convert commerce_payment_method_info to array), code in commerce_payment.checkout_pane.inc should be this one:
Comment #2
rszrama commentedI don't understand why you copied the array to the $payment_methods variable instead of just using uasort() on $order->payment_methods directly. Also, if we're going to do a uasort(), we'll want to make sure the payment methods array is actually an array prior to passing it to the sort function (i.e. we can ditch the array casting that exists in the current pull request).
Comment #3
rszrama commentedAlso, you won't need a separate pull request. If there's some rationale I'm missing, I can pull and tweak the array as is... otherwise I'll pull and revert the variable to sort the $order->payment_methods directly. Just want to make sure I'm not missing something with your variable assignment.
Comment #4
rszrama commentedAlrighty, based on pcambra's feedback in IRC and my tests, I've simplified the patch to two minor changes:
https://github.com/rszrama/drupalcommerce/commit/220d2a00a35db0f19d1618e...