woocommerce product weight unit programmatically code example
Example: woo commerce print size and weight on product page
add_action ('woocommerce_single_product_summary', 'show_weight', 20);
function show_weight() {
global $product;
$weight_unit = get_option('woocommerce_weight_unit');
$attributes = $product->get_attributes();
if ( $product->has_weight() ) {
print '<p>Weight: '.$product->get_weight(). $weight_unit . '</p>'.PHP_EOL;
}
}