Automattic\WooCommerce\Internal\ProductAttributesLookup
LookupDataStore::is_variable_product()
Check if a given product is a variable product.
Method of the class: LookupDataStore{}
No Hooks.
Return
true|false
. True if it's a variable product, false otherwise.
Usage
// private - for code of main (parent) class only $result = $this->is_variable_product( $product );
- $product(\WC_Product) (required)
- The product to check.
LookupDataStore::is_variable_product() LookupDataStore::is variable product code WC 9.6.1
private function is_variable_product( \WC_Product $product ) { return is_a( $product, \WC_Product_Variable::class ); }