Add Length, Height and Width to Single-product

Goes into functions.php

function twstudio_custom_dimension_action() {

	global $product;

	if ( ! empty( $product->get_length() ) ) {

		echo '<div class="dimensions">';
		echo '<br><b>Lengde: </b>' . $product->get_length() . get_option( 'woocommerce_dimension_unit' );
		echo '<br><b>Bredde: </b>' . $product->get_width() . get_option( 'woocommerce_dimension_unit' );
		echo '<br><b>Høyde: </b>' . $product->get_height() . get_option( 'woocommerce_dimension_unit' );
		echo '</div>';
	}

};
add_action( 'woocommerce_single_product_summary', 'twstudio_custom_dimension_action', 55 );

Leave a Reply

Your email address will not be published. Required fields are marked *