Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Change shipping method default


Guest

Recommended Posts

This is probably a really quick one to fix, but any help would be appreciated. I can change the order of the shipping modules but regardless of the order the same one is always highlighted as the default (flat rate). I want to change the one it defaults to and make it table rate. Suggestions?

 

Thanks in advance.

Link to comment
Share on other sites

I am a newbie and there is probably a better way to do it, but if you don't need the flat rate, you can just delete it and it will go away and you won't have to deal with it. That is what I did. i hope that helps. Aaron

Link to comment
Share on other sites

Hi Aaron,

 

Thanks for your suggestion. I actually want to keep both shipping modules as I am offering free shipping (via the flat rate module) to certain areas but I want the other shipping module (table rate) to be the one the software defaults to (highlights when the page opens).

 

Thanks,

czarbjones.

Link to comment
Share on other sites

Ok here's the solution I came up with:

 

In file:

 

/checkout_shipping.php

 

Around line 147 look for this:

 

if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) && (tep_count_shipping_modules() > 1) ) ) $shipping = $shipping_modules->cheapest();

 

Which causes the shipping module to default to the cheapest method. To stop it defaulting to any shipping method and just leave it up to the customer change it to this:

 

//if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) && (tep_count_shipping_modules() > 1) ) ) $shipping = $shipping_modules->cheapest();

 

which comments it out altogether.

 

Good luck,

czarbjones.

Link to comment
Share on other sites

or $shipping_modules->cheapest();

 

modifu function cheapest()

 

if (is_array($cheapest)) {

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

$cheapest = $rates[$i];

}

}

 

to

 

if (is_array($cheapest)) {

if ($rates[$i]['title'] == "title of flat rate") {

$cheapest = $rates[$i];

}

}

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...