Created
March 16, 2015 19:56
-
-
Save bekarice/13acd0241a6ab8b64364 to your computer and use it in GitHub Desktop.
Adds a custom "league" unit to WooCommerce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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