Option to change shipping address still appears, which is not ideal.
From what I understand, you’re trying to hide the shipping address option in your WooCommerce cart and checkout when the local pickup is selected. I see that you’ve tried to implement a code snippet from Business Bloomer but it didn’t work as expected.
Firstly, I’d like to confirm that the code you’ve provided should work correctly as it’s designed to hide the shipping fields if local pickup is chosen as the shipping method.
However, there can be several reasons why it might not be working on your site:
Theme Compatibility: Some themes might not be fully compatible with WooCommerce, which could lead to unexpected behaviors. Try switching to a default WordPress theme (like Storefront) temporarily to see if the issue persists.
Plugin Conflict: Another plugin might be interfering with the code snippet. Try deactivating all other plugins except WooCommerce and the Code Snippets plugin, then check if the issue remains.
Code Placement: Make sure the code is placed correctly. It should be added to your theme’s functions.php file or a site-specific plugin. If you’re using the Code Snippets plugin, ensure it’s activated and the snippet is running without errors.
WooCommerce Version: The code snippet is tested with WooCommerce 7. If you’re using an older version, the code might not work as expected. Consider updating WooCommerce to the latest version.
If none of the above solutions work, there might be a more complex issue at hand. In this case, I’d recommend seeking help from a developer or a WooCommerce expert. They should be able to diagnose the problem and provide a custom solution.
?? Just a heads up – while we’re always here to assist you, our scope of support doesn’t extend to custom development or design patterns, which includes troubleshooting or giving specific advice on using custom action hooks or filters.
For custom solutions, our recommendation is to connect with Codeable.io, our trusted WooCommerce development partner. They’re experts in crafting custom solutions for WooCommerce and might be able to help you develop a custom solution for your problem. Check them out here: ?? https://woocommerce.com/codeable
I hope this helps! Please let me know how it goes or if you have any other questions.