Guest User

Untitled

a guest
Oct 17th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. add_filter('woocommerce_cart_needs_shipping_address', '__return_true');
  2. add_filter('woocommerce_order_needs_shipping_address', '__return_true');
  3.  
  4. function my_custom_shipping_fields($fields) {
  5. foreach ($fields as $key => $field) {
  6. if (stristr($key, 'shipping_')) {
  7. $fields[$key]['required'] = FALSE; // Also tried unsetting the field
  8. }
  9. }
  10. }
  11.  
  12. add_action('woocommerce_after_checkout_shipping_form', 'my_form_config');
  13.  
  14. function my_form_config($checkout) {
  15. ?>
  16. <script>
  17. jQuery('div.woocommerce-shipping-fields__field-wrapper abbr.required').remove();
  18. </script>
  19. <?php
  20. }
Add Comment
Please, Sign In to add comment