Skip to content

Instantly share code, notes, and snippets.

@ChrisFlannagan
Created January 12, 2018 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisFlannagan/bcfe4ea1cbfdcd629db7f292c22cc40c to your computer and use it in GitHub Desktop.
Save ChrisFlannagan/bcfe4ea1cbfdcd629db7f292c22cc40c to your computer and use it in GitHub Desktop.
<?php
add_filter( 'woocommerce_settings_api_form_fields_cod', function( $form_fields ) {
$form_fields[ 'custom_fee' ] = [
'title' => __( 'Fee in $', 'textdomain' ),
'type' => 'number',
'description' => __( 'Add a fee to orders using Cash on Delivery gateway.', 'textdomain' ),
'default' => 0,
'min' => 0,
'step' => .01,
'desc_tip' => true,
];
return $form_fields;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment