-
-
Save rotisoft/14b898afa5b23c3e2689e74d67852c19 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