Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Set/Change default shipping method


GemRock

Recommended Posts

I know there's a contribution for this, but for those who simply want to set to default a shipping method of his/her choice, which is not the cheapest, then here is a simpler, quicker way of doing it:

 

1. open [catalog]includes/classes/shipping.php for edit. Look for at around line 112 & 115 these two lines of code:

$cheapest = $rates[$i];

and change both to:

$cheapest = $rates[0];

2. in admin, modules - shipping, give/change the sort order of the shipping method you want to set as default to 1, ie, the top most, or you will need to the '0' in

$rates[0]

as shown above to a number that corresponds to your chosen shipping method's sort order, eg, 1 for sort order 2.

 

No other change is needed.

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

  • 5 months later...
I know there's a contribution for this, but for those who simply want to set to default a shipping method of his/her choice, which is not the cheapest, then here is a simpler, quicker way of doing it:

 

1. open [catalog]includes/classes/shipping.php for edit. Look for at around line 112 & 115 these two lines of code:

$cheapest = $rates[$i];

and change both to:

$cheapest = $rates[0];

2. in admin, modules - shipping, give/change the sort order of the shipping method you want to set as default to 1, ie, the top most, or you will need to the '0' in

$rates[0]

as shown above to a number that corresponds to your chosen shipping method's sort order, eg, 1 for sort order 2.

 

No other change is needed.

Ken

 

Was just about to install that contribution as I've just setup a store pickup rate (which then became the default choice as its free - not too great) - you have saved me a lot of time. Thanks!

Link to comment
Share on other sites

  • 2 months later...

Thanks!!! I was digging through the contributions for something to sort my shipping methods, as I had the same problem with the cheapest method. I couldn't really find anything that suited my problem, so I decided to google for tips and stumbled on your post :thumbsup: :thumbsup:

Link to comment
Share on other sites

  • 4 weeks later...
  • 7 months later...

Thank you!

 

I know there's a contribution for this, but for those who simply want to set to default a shipping method of his/her choice, which is not the cheapest, then here is a simpler, quicker way of doing it:

 

1. open [catalog]includes/classes/shipping.php for edit. Look for at around line 112 & 115 these two lines of code:

$cheapest = $rates[$i];

and change both to:

$cheapest = $rates[0];

2. in admin, modules - shipping, give/change the sort order of the shipping method you want to set as default to 1, ie, the top most, or you will need to the '0' in

$rates[0]

as shown above to a number that corresponds to your chosen shipping method's sort order, eg, 1 for sort order 2.

 

No other change is needed.

Ken

Link to comment
Share on other sites

  • 2 years later...

Another alternative is to make it so that the cheapest non-free shipping rate is the default by simply changing the IF at line 111

 

FROM:

 

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

 

TO:

 

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

 

That's what works best for me, hopefully it'l help others too.

Link to comment
Share on other sites

  • 10 months later...

Archived

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

×
×
  • Create New...