A
A
Alexander2021-03-18 14:37:23
WordPress
Alexander, 2021-03-18 14:37:23

How to remove automatic selection of the first shipping method in Woocommerce?

Means only for a user who has not previously chosen any delivery method and information about the selected method is not stored in the session.
But Woocommerce forces the first shipping method to be written into the session and selects it, even if the user is faced with a choice for the first time.
Previously, before version 4.0, as they say, there was a hook solution

// Code to clear default shipping option.
add_filter( 'woocommerce_shipping_chosen_method', '__return_false', 99);

but in newer versions is there a way to avoid automatically selecting the default (first) shipping method?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question