Pre-select a shipping method
Permalink Browser Info Environment
Hi,
In the check process, how can I set the first shipping method radio button to selected when the page loads?
Cheers,
Nathan.
In the check process, how can I set the first shipping method radio button to selected when the page loads?
Cheers,
Nathan.
Type: | Discussion |
---|---|
Status: | New |
I guess you mean a situation where you have more than one regional rates defined for a specific shipping area, right?
If this is the case, unfortunately this is not in our hands as this is related to the eCommerce add-on itself. What it allows us to do is to return one or multiple shipping rates and then eCommerce lets the end user decide which one to select if the shipping module returns more than one shipping rate.
But the file you need to override from that add-on is:
/packages/core_commerce/elements/checkout/shipping/method.php
Please keep in mind that it already pre-selects the shipping method if you've selected it already for that order. So your pre-selection of the first option should not probably prevent the default behavior.
Other option (which probably wouldn't require any overrides) would be to attach to some of the eCommerce events and pre-select a shipping method at some step before the shipping methods step but this might be quite more challenging task compared to the previous suggestion.
Best,
Antti / Mainio