Page 1 of 1

Preselected "standard" shipping method

Posted: Sat Feb 24, 2024 10:00 am
by loop
Hi All
i cannot find out, how i can choose a specific shipping method to be preselected whenn going to checkout_shipping and nothing was selected before. i would like to specify a certain method. It would be the best if this could be done in the specific shipping class (if not it's also ok, but this would be the most elegant way)

thanks in advance for any tips

Re: Preselected "standard" shipping method

Posted: Sat Feb 24, 2024 10:34 am
by ecartz
Something like

Code: Select all

if (!isset($_SESSION['shipping']) {
  $_SESSION['shipping'] = [
    'id' => 'module_method',
    'title' => 'Title',
    'cost' => $cost,
  ];
}
Change module_method and Title to the appropriate values and set the $cost appropriately.

You could probably do that in the quotes method of the shipping module.