WC_Product::has_attributes
Returns whether or not the product has any visible attributes.
Method of the class: WC_Product{}
No Hooks.
Returns
true|false.
Usage
$WC_Product = new WC_Product(); $WC_Product->has_attributes();
WC_Product::has_attributes() WC Product::has attributes code WC 10.3.6
public function has_attributes() {
foreach ( $this->get_attributes() as $attribute ) {
if ( $attribute->get_visible() ) {
return true;
}
}
return false;
}