Last active
January 16, 2018 12:55
-
-
Save trueqap/7287e46ef293c0b23bc87f5c2d2e10c2 to your computer and use it in GitHub Desktop.
WooCommerce simple or variable product
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
?php | |
$product = new WC_Product( get_the_ID() ); // in function.php maybe... | |
if( $product->is_type( 'simple' ) ){ | |
// a simple product | |
} elseif( $product->is_type( 'variable' ) ){ | |
// a variable product | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment