You’ll need the shipping method radio button value from the shipping method you wish to enable and disable.
Simply copy the pre-coded solution to your active theme’s functions.php or preferably the Code Snippets Plugin.
Need support with the snippet? We’re Here to Help You, Contact Us!
A lot of online stores allow free delivery before a certain time of day depending on the courier used. This guide shows you how you can enable the shipping method, free shipping between midnight and 2PM in the afternoon. After 2PM, the free shipping option is turned off. If you need this solution implemented but between different times, simply the times in the code as necessary. You will need the shipping method radio button value which you can get by using your browser’s develop tools to inspect the radio button li class and grabbing the value. You’ll also need to clear customer sessions by going to Dashboard > WooCommerce > Status > Tools > Clear customer sessions. Because of this, it’s a good idea to implement this solution when there is little traffic on the website as clearing custom sessions will empty their cart.
Use your browser’s dev tools to inspect the radio button and grab the value from the li class as shown in the screenshot.
Introduce urgency by limiting free shipping between certain hours in the day.
Join forces with UnlimitedWP for an outsourced white label web development service you can truly rely on.