Preselected "standard" shipping method

Open to all! Ask other shopowners for help.
Post Reply
loop
Contributor
Posts: 253
Joined: Thu Mar 25, 2021 12:26 pm
Phoenix Version:
Has thanked: 7 times
Been thanked: 3 times

Preselected "standard" shipping method

Post 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


Join The Code Co-op to get access to your library in the Code Co-op Forum
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Preselected "standard" shipping method

Post 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.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply