Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to select default shipping method


Geoff_m

Recommended Posts

Posted

How do you select the default shipping method. I have 2 shipping modules active, the first is a postal method, the second is pick-up from store.

The default radio button (green) will only default to the second (pick-up) method which I don't want as the default. I have tried changing sort order of them, then back again, but will only default to pick-up

 

Any ideas thanks

Posted
How do you select the default shipping method. I have 2 shipping modules active, the first is a postal method, the second is pick-up from store.

The default radio button (green) will only default to the second (pick-up) method which I don't want as the default. I have tried changing sort order of them, then back again, but will only default to pick-up

 

Any ideas thanks

 

 

it defaults to the cheapest one. I have not yet figured out a way to circumvent that.

Treasurer MFC

Posted

Ok, that explains why 2hrs of fiddling around proved fruitless.

The reason why this bothers me is that if a customer does not alter the default shipping mode manually, the order will go through freight free.

Any suggestions to get around this without disabeling the module as I do require a 'pick-up' alternative?

 

Thanks

Posted
Ok, that explains why 2hrs of fiddling around proved fruitless.

The reason why this bothers me is that if a customer does not alter the default shipping mode manually, the order will go through freight free.

Any suggestions to get around this without disabeling the module as I do require a 'pick-up' alternative?

 

Thanks

 

I use three shipping methods: Pick-up, USPS and UPS XML. I always want UPS Ground to be my default shipping method so I made the following change in catalog/includes/classes/shipping.php

 

Look for:

 

if (is_array($cheapest)) {
           if ($rates[$i]['cost'] < $cheapest['cost']) {
             $cheapest = $rates[$i];
           }
         } else {
           $cheapest = $rates[$i];
         }
       }

 

and change it to:

 

for ($i=0, $n=sizeof($rates); $i<$n; $i++) {
              if ($rates[$i]['id'] == 'upsxml_UPS Ground') {
                $cheapest = $rates[$i];
              }
       }
    }

 

Please note that you must use the UPS XML shipping module for this to work.

 

Regards,

 

Donna Gordon

UKGoods

Posted
I use three shipping methods:  Pick-up, USPS and UPS XML.  I always want UPS Ground to be my default shipping method so I made the following change in catalog/includes/classes/shipping.php

 

Look for:

 

if (is_array($cheapest)) {
? ? ? ? ? ?if ($rates[$i]['cost'] < $cheapest['cost']) {
? ? ? ? ? ? ?$cheapest = $rates[$i];
? ? ? ? ? ?}
? ? ? ? ?} else {
? ? ? ? ? ?$cheapest = $rates[$i];
? ? ? ? ?}
? ? ? ?}

 

and change it to:

 

for ($i=0, $n=sizeof($rates); $i<$n; $i++) {
? ? ? ? ? ? ? if ($rates[$i]['id'] == 'upsxml_UPS Ground') {
? ? ? ? ? ? ? ? $cheapest = $rates[$i];
? ? ? ? ? ? ? }
? ? ? ?}
? ? }

 

Please note that you must use the UPS XML shipping module for this to work.

 

Regards,

 

Donna Gordon

UKGoods

Posted
I use three shipping methods:  Pick-up, USPS and UPS XML.  I always want UPS Ground to be my default shipping method so I made the following change in catalog/includes/classes/shipping.php

 

Look for:

 

if (is_array($cheapest)) {
? ? ? ? ? ?if ($rates[$i]['cost'] < $cheapest['cost']) {
? ? ? ? ? ? ?$cheapest = $rates[$i];
? ? ? ? ? ?}
? ? ? ? ?} else {
? ? ? ? ? ?$cheapest = $rates[$i];
? ? ? ? ?}
? ? ? ?}

 

and change it to:

 

Thanks Donna, I will give this a go. Thanks for your reply

Geoff

for ($i=0, $n=sizeof($rates); $i<$n; $i++) {
? ? ? ? ? ? ? if ($rates[$i]['id'] == 'upsxml_UPS Ground') {
? ? ? ? ? ? ? ? $cheapest = $rates[$i];
? ? ? ? ? ? ? }
? ? ? ?}
? ? }

 

Please note that you must use the UPS XML shipping module for this to work.

 

Regards,

 

Donna Gordon

UKGoods

 

Thanks Donna, I'll give this a go.

rgds Geoff

Posted
Thanks Donna, I'll give this a go.

rgds Geoff

 

Or change

if ($rates[$i]['cost'] < $cheapest['cost']) {

 

to

if ($rates[$i]['cost'] > $cheapest['cost']) {

which picks the most expensive method which should be appropriate in your case.

  • 10 months later...
Posted
Or change

if ($rates[$i]['cost'] < $cheapest['cost']) {

 

to

if ($rates[$i]['cost'] > $cheapest['cost']) {

which picks the most expensive method which should be appropriate in your case.

 

 

Even if you dont have UPS XML installed it will still work, simple use 'ups_GND' instead of 'upsxml_UPS Ground'

 

for ($i=0, $n=sizeof($rates); $i<$n; $i++) {

if ($rates[$i]['id'] == 'ups_GND') {

$cheapest = $rates[$i];

}

}

  • 5 months later...
Posted
Or change

if ($rates[$i]['cost'] < $cheapest['cost']) {

 

to

if ($rates[$i]['cost'] > $cheapest['cost']) {

which picks the most expensive method which should be appropriate in your case.

 

Brilliant tip! :thumbsup: :thumbsup:

  • 1 year later...
Posted
How do you select the default shipping method. I have 2 shipping modules active, the first is a postal method, the second is pick-up from store.

The default radio button (green) will only default to the second (pick-up) method which I don't want as the default. I have tried changing sort order of them, then back again, but will only default to pick-up

 

Any ideas thanks

 

I just installed the shipping methods default contribution for this and it works great. Here's the link:

 

http://www.oscommerce.com/community/contributions,4396

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...