New weight unit for WooCommerce products
The snippet can be accessed without any authentication.
Authored by
Krzysztof Dyszczyk
Edited
functions.php 408 B
/**
* This adds the new weight unit to WooCommerce
*/
function add_woocommerce_weight_unit_pallet( $settings ) {
foreach ( $settings as &$setting ) {
if ( 'woocommerce_weight_unit' == $setting['id'] ) {
$setting['options']['pallet'] = __( 'pallet', 'woocommerce' ); // new unit
}
}
return $settings;
}
add_filter( 'woocommerce_products_general_settings', 'add_woocommerce_weight_unit_pallet' );
Please register or sign in to comment