Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Shipping options lowest value default


Recommended Posts

Is there a quick way to stop the checkout_shipping page,

from selecting the lowest value shipping rate option by default ?


E.G>If you have several shipping options, and want a particular option to be highlighted by default, but its value was say $5.00, and you had two others at $3.00 and $1.50.


The $1.50 always gets the default selection...


Maybe it's possible to assign the default in the shipping mod relevant page?


Thanks for any help with this :wink:

Link to comment
Share on other sites

a quick update...


I found the place to edit in checkout_shipping.php



// if no shipping method has been selected, automatically select the cheapest method.

// if the modules status was changed when none were available, to save on implementing

// a javascript force-selection method, also automatically select the cheapest shipping

// method if more than one module is now enabled

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



RE: if no shipping method has been selected


I thought if is edited the $shipping_modules->cheapest();

to : $shipping_modules->table; for example.


It would default to the table rate shipping selection..

but it does not appear to do that... basically

it just stops any pre-selection taking place.



the other file involved is :



which contains the cheapest function..



Any ideas how to define a pre selected shipping option ?


Also.. what happens then, if you have a defined option, but

say you have a different zone, for which table rate is not

displayed... will the pre-selection system error out ?

Link to comment
Share on other sites

:lol: talking to myself here... but ive found a fix for this, and

i figure other people might need to do this also, at some point, so..


$shipping = $shipping_modules->cheapest();



edit to : $shipping = 'table_table';

forces a pre selection for the table rate option.


the radio buttons have like double names of the relevant shipping modules.. so you could have 'ukpost_ukpost' or 'usafed_usafed' etc.. etc.


if you pre-select a specific mod, but its not an option for some zone..

no problem.. the pre-select just doesnt happen, and it forces a manual select. :)

Link to comment
Share on other sites

  • 1 month later...
  • 6 months later...
  • 1 month later...



Hmm, I have the same issues, however I dont have the checkout_shipping.php. So I think I am supposed to edit this in checkout_payment.php instead?


Not sure which snapshot it is, if it is earlier or later.


The only line I can find in the above file that looks anything like yours is:




Any ideas on how to make my store default to the zones module?


Right now it defaults to cheapest and I dont want that, since it is for pickup only.


Thankful for help.



Link to comment
Share on other sites

  • 2 months later...

Yes very helpful - thanks Mark - I was just trying to figure this out myself and here I find somebody 1 year earlier was going through exactly the same thought process saving me a lot of time!


Best wishes... adam.

Link to comment
Share on other sites


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

  • Create New...