Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('woocommerce_cart_needs_shipping_address', '__return_true');
- add_filter('woocommerce_order_needs_shipping_address', '__return_true');
- function my_custom_shipping_fields($fields) {
- foreach ($fields as $key => $field) {
- if (stristr($key, 'shipping_')) {
- $fields[$key]['required'] = FALSE; // Also tried unsetting the field
- }
- }
- }
- add_action('woocommerce_after_checkout_shipping_form', 'my_form_config');
- function my_form_config($checkout) {
- ?>
- <script>
- jQuery('div.woocommerce-shipping-fields__field-wrapper abbr.required').remove();
- </script>
- <?php
- }
Add Comment
Please, Sign In to add comment