Right now the FedEx module outputs the shipping options in alphabetical order. so "2 day" shipping is at the top and "ground" is in the middle. I really think this should be sorted by price because most consumers are familiar with it being ordered that way. Always have the least expensive option on top so that it defaults to what the user is most likely going to want - because right now the default is "2 day" which is my most expensive option of shipping.
It would also be nice to order all shipping options so I can say I want my "free shipping" flat rate on the top (and default) and then have FedEx next, then UPS. or intermingle FedEx and UPS so they gradually increase in price and expedition.
Comment | File | Size | Author |
---|---|---|---|
#2 | sort-rates-by-price-asc-1955574.patch | 980 bytes | mglaman |
#1 | Screen Shot 2013-03-28 at 3.30.36 PM.png | 29.46 KB | mglaman |
Comments
Comment #1
mglamanI started to look into this. I was able to successfully sort the array response using the following code in commerce_fedex_service_rate_order right before the return value.
Comment #2
mglamanHere is a patch I made for the module. It uses explode() to get the shipping rate prices and does an array_multisort() to get prices listed in ascending order.
Comment #3
iwant2fly CreditAttribution: iwant2fly commentedI would also be very interested in this ability, as well as maybe a way to change the name of the service offering. Having it say [FedEXLOGO] FedEx 2 Day is redundant.
Comment #4
iwant2fly CreditAttribution: iwant2fly commentedWould this be better to report/request in the Commerce_Shipping Module, so that it sorts all available shipping options by price rather than just the FedEx ones?
Comment #5
mesch CreditAttribution: mesch commentedSee http://drupal.org/node/1537394#comment-7399800 for a possible solution to sorting all shipping services by price.
Comment #6
mglaman@MEsch this is true, but it my opinion a shipping service should be by rate on its own, then individual module to shuffle all together.
Also realized this was never marked for review.
Comment #7
kevinsiji CreditAttribution: kevinsiji commentedThe patch at #2 did not worked until I changed the explode to
$shipping_rate_cost = explode(': $', $shipping_rate);
Comment #8
prophet108 CreditAttribution: prophet108 commentedCan we get this worked into the next commit?
Comment #9
andyg5000Typically I handle this with @mglaman's sort routine that affects all shipping methods (including non FedEx).
http://glamanate.com/blog/sort-drupal-commerce-shipping-services
I think this should actually be added as an option in commere_shipping. If more people think that this should be set at the per-provider level, I'm happy to revisit, but either way this is not a critical bug.