woo commerce print size and weight on product page 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 'Weight: '.$product->get_weight(). $weight_unit . '
'.PHP_EOL;
}
}