Last active
May 11, 2018 06:50
-
-
Save woogists/c9ba3493b13e9b4d803ae9a7a7237178 to your computer and use it in GitHub Desktop.
[General Snippets][Display product dimensions on archive pages] Display product dimensions on archive pages, below the title of the product for WooCommerce v3 and below
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
/** | |
* Show product dimensions on archive pages WC 3 and below | |
*/ | |
add_action( 'woocommerce_after_shop_loop_item_title', 'wc_show_dimensions', 9 ); | |
function wc_show_dimensions() { | |
global $product; | |
$dimensions = $product->get_dimensions(); | |
if ( ! empty( $dimensions ) ) { | |
echo '<span class="dimensions">' . $dimensions . '</span>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment