There are no pre-requisites in order for you to be able to implement this solution.
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!
This guide shows you how to hide a specific shipping method option and only enable it when a specific coupon code has been entered. For this to work properly, you will need to tweak the line 10 in the code – the specific coupon code to enable the hidden shipping method option, and line 13 in the code – the shipping method radio option value. You can get the shipping method radio option value by first going to the checkout page, using inspect element, clicking the radio button of the shipping method, then expanding the li class. It will look something like “local_pickup:13”. You’ll also need to clear all customer sessions under Dashboard > WooCommerce > Status > Tools. This tool will empty all active customer baskets so it’s probably best to do this when the site is quiet. This is a very niche solution but some parts of the code could help you implement a similar solution your business requires.
Use your browser’s developer tools to inspect the radio button and get the value like shown in the image.
Join forces with UnlimitedWP for an outsourced white label web development service you can truly rely on.