Skip to content

Latest commit

 

History

History
72 lines (44 loc) · 2.6 KB

README.md

File metadata and controls

72 lines (44 loc) · 2.6 KB

Kybernaut IC DIC (WordPress plugin)

plugin version CI

Adds Czech Company & VAT numbers (IČO & DIČ) to WooCommerce billing fields and verifies if data are correct. Download here: https://wordpress.org/plugins/woolab-ic-dic/

Unreleased changes

  • none

Filters

Custom class for fields: woolab_icdic_class_{field_name}

If you need to modify class of outputed fields. For example you want to have billing_ic and billing_dic in one row.

Example:

add_filter( 'woolab_icdic_class_billing_ic', 'my_theme_class_billing_ic', 10, 1 );
function my_theme_class_billing_ic ( $class ) {
  return array('form-row-first');
}

add_filter( 'woolab_icdic_class_billing_dic', 'my_theme_class_billing_dic', 10, 1 );
function my_theme_class_billing_dic ( $class ) {
  return array('form-row-last');
}

add_filter( 'woolab_icdic_class_billing_dic_dph', 'my_theme_class_billing_dic_dph', 10, 1 );
function my_theme_class_billing_dic_dph ( $class ) {
  return array('form-row-last');
}

Manipulate the plugin settings:

If you need to set it up in your theme or plugin, you can use following filters to do so:

Example:

add_filter( 'woolab_icdic_ares_check', '__return_true' );

add_filter( 'woolab_icdic_ares_fill', '__return_true' );

add_filter( 'woolab_icdic_vies_check', '__return_true' );

add_filter( 'woolab_icdic_ignore_check_fail', '__return_true' );

add_filter( 'woolab_icdic_vat_exempt_enabled', function(){
  return "no"; // or "yes"
} );

add_filter( 'woolab_icdic_base_country', function(){
  return "SK";
} );

Update user meta while edition order details: woolab_icdic_update_user_meta

By default, if you edit order details, user profile is not touched. If you want to update user details when you add or edit ICO or DIC value, use this filter.

Example:

add_filter( 'woolab_icdic_update_user_meta', '__return_true' );

Disable required DIC when ICO filled in SK

add_filter( 'woolab_icdic_sk_required_ic_and_dic', '__return_false' );

Credits