Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bekarice/13acd0241a6ab8b64364 to your computer and use it in GitHub Desktop.
Save bekarice/13acd0241a6ab8b64364 to your computer and use it in GitHub Desktop.
Adds a custom "league" unit to WooCommerce
/**
* This adds the new unit to the WooCommerce admin
*/
function add_woocommerce_dimension_unit_league( $settings ) {
foreach ( $settings as &$setting ) {
if ( 'woocommerce_dimension_unit' == $setting['id'] ) {
$setting['options']['league'] = __( 'league' ); // new unit
}
}
return $settings;
}
add_filter( 'woocommerce_products_general_settings', 'add_woocommerce_dimension_unit_league' );
@onebook0505
Copy link

Hi @bekarice,why woocommerce_area_unit is not working?

in measurement tab, if not enabled Calculated Price,how can i show the product dimensions in the cart?

WooCommerce version 3.5.7
WooCommerce Measurement Price Calculator version 3.14.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment