Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Make Cheapest Shipping Show Up First -- UPS

Make Cheapest Shipping Show Up First -- UPS

Locked

Views: 2,768

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
28 Oct 2007, 7:34 PM
#1
srturner47 avatar

srturner47

Zen Follower

Join Date:
Oct 2007
Posts:
385
Plugin Contributions:
0

Make Cheapest Shipping Show Up First -- UPS

Is there a way to make the cheapest shipping options show up first with UPS? Right now, the highest price shipping option is listed first. I'd like to reverse the order, making it lowest to highest.

Thanks!

14 Nov 2007, 1:32 AM
#2
srturner47 avatar

srturner47

Zen Follower

Join Date:
Oct 2007
Posts:
385
Plugin Contributions:
0

Re: Make Cheapest Shipping Show Up First -- UPS

I'm still looking for a way to do this... If anyone has any ideas I sure would appreciate it. It would be really nice for my customers to see the cheapest option first.

Thanks!

14 Nov 2007, 4:06 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Make Cheapest Shipping Show Up First -- UPS

Zen Cart's normal behavior is to auto-select the cheapest shipping option.
If yours isn't doing that, then you're not using original Zen Cart code ... perhaps you've made customizations to your site that have caused that behavior to not function correctly.

14 Nov 2007, 4:13 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Make Cheapest Shipping Show Up First -- UPS

Or ... are you saying you want them to show in price-sorted order?

I believe the default sort order from UPS is fastest-to-slowest, not cheapest-to-most expensive.

14 Nov 2007, 6:52 AM
#5
srturner47 avatar

srturner47

Zen Follower

Join Date:
Oct 2007
Posts:
385
Plugin Contributions:
0

Re: Make Cheapest Shipping Show Up First -- UPS

Exactly! It does pick the cheapest shipping option.

I am concerned about the sort order. I'd rather it sort from cheapest at the top to most expensive at the bottom instead of by speed.

I want the first thing my customer see to be cheap! :)

Thanks!

14 Nov 2007, 9:35 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Make Cheapest Shipping Show Up First -- UPS

Around line 180 of your usp.php shipping module file, you'll see code that looks like this:

        $methods[] = array('id' => $type,
                           'title' => $this->types[$type],
                           'cost' => ($cost + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes);
      }

      $this->quotes['methods'] = $methods;

Make a few adjustments, like this:```
$methods[] = array('cost' => ($cost + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes,
'id' => $type,
'title' => $this->types[$type]
);
}
[B] sort($methods);[/B]

  $this->quotes['methods'] = $methods;
17 Nov 2007, 2:54 AM
#7
srturner47 avatar

srturner47

Zen Follower

Join Date:
Oct 2007
Posts:
385
Plugin Contributions:
0

Re: Make Cheapest Shipping Show Up First -- UPS

Thank you, thank you, thank you! That worked like a charm. I also did the same thing for USPS without any problems.

I appreciate the help! :)