When attempting to select more than one shipping method, only the first method returns a value.
----
Breaking down the issue within the code:
http://drupalcode.org/sandbox/andrewmriley/1410424.git/blob/HEAD:/commer...
Defines multiple shipping methods (foreach $enabled, $machine_name) with a rate callback of commerce_usps_rate. So, this will call the function for each service.
Now, in commerce_usps_rate, the request is built (function in commerce_usps.xml.inc):
http://drupalcode.org/sandbox/andrewmriley/1410424.git/blob/HEAD:/commer...
For all USPS services:
http://drupalcode.org/sandbox/andrewmriley/1410424.git/blob/HEAD:/commer...
This then builds $rates for all of the methods under the same $service['name'] because $service remains the same within the loop:
http://drupalcode.org/sandbox/andrewmriley/1410424.git/blob/HEAD:/commer...
Further, we're caching the rates to lower the performance hit:
http://drupalcode.org/sandbox/andrewmriley/1410424.git/blob/HEAD:/commer...
Which, causes it never to get to the next option.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | first_method_only-1470924-1.patch | 2.91 KB | albert volkman |
Comments
Comment #1
albert volkman commentedThis patch seems to pull the correct values back for all of the methods, but it is far from efficient.
The formatting is a little ugly as to focus on the actual diff.
Comment #2
andrew m riley commentedNice fix! This is now in master.