Duplicate Snippet
Embed Snippet on Your Site
WooCommerce: Restrict Shipping Methods by User Role (Logged In, Logged Out, Custom Roles)
This snippet allows you to control which shipping methods are visible at checkout based on the customer's user role in WooCommerce.
- Supports all shipping methods (Flat Rate, Free Shipping, Local Pickup, etc.)
- Easily configure allowed roles per shipping method (including "Logged In" and "Logged Out")
-If no roles are selected, the shipping method remains available to everyone
Code Preview
php
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Comments