
Originally Posted by
njcyx
One more update. I just generally tested this plug-in (v0.9) and it worked great. One suggestion: I noticed that there is no option to resort the result. So by default, the highest quote shows at the top and the lowest quote shows at the bottom. It could be more customer friendly if the display can be reversed, so the lowest quote shows at the top. The code in the following post still works.
https://www.zen-cart.com/showthread....83#post1117683
I just checked the latest USPS module (k11i), and the sorting function looks more professional (thanks @lat9 ). You may refer to it for this function:
Near line 885
PHP Code:
// sort results
if (MODULE_SHIPPING_USPS_QUOTE_SORT !== 'Unsorted') {
if (count($methods) !== 0) {
if (strpos(MODULE_SHIPPING_USPS_QUOTE_SORT, 'Price') === 0) {
foreach ($methods as $c => $key) {
$sort_cost[] = $key['cost'];
$sort_id[] = $key['id'];
}
array_multisort($sort_cost, (MODULE_SHIPPING_USPS_QUOTE_SORT === 'Price-LowToHigh' ? SORT_ASC : SORT_DESC), $sort_id, SORT_ASC, $methods);
} else {
foreach ($methods as $c => $key) {
$sort_key[] = $key['title'];
$sort_id[] = $key['id'];
}
array_multisort($sort_key, (MODULE_SHIPPING_USPS_QUOTE_SORT === 'Alphabetical' ? SORT_ASC : SORT_DESC), $sort_id, SORT_ASC, $methods);
}
}
}