Created
June 24, 2013 22:28
-
-
Save BFTrick/5854267 to your computer and use it in GitHub Desktop.
You can get a products weight using this snippet. You will need to be in the product loop to access it or on a page like content-single-product.php where you're already within the loop.
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
global $product; | |
$attributes = $product->get_attributes(); | |
if ( $product->has_weight() ) { | |
echo $product->get_weight(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment