I'm using the UPS shipping module and it sorts the shipping rates from greatest to least.
Is there a way to reverse this?
Thanks in Advance
~D
I'm using the UPS shipping module and it sorts the shipping rates from greatest to least.
Is there a way to reverse this?
Thanks in Advance
~D
What version of Zen Cart?
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
1.3.8a
Two edits to /includes/modules/shipping/ups.php:
1. Add this to the very bottom of the file (If the file ends with a ?>, then remove the ?> altogether and put this at the bottom)2. Find (around line 185 or so) this line, and add the line shown in red above it:Code:function ups_sort_by_price($a, $b) { $c=(float)$a['cost']; $d=(float)$b['cost']; if ($c==$d) return 0; return ($c>$d?1:-1); }Code:usort($methods,'ups_sort_by_price'); // sort methods by price $this->quotes['methods'] = $methods;
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Thanks Dr B !!
Is this code change the same for 1.5.0?
Probably.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Works perfectly. Thank you.
Bookmarks