WordPress at Your Fingertips
function is not described

WC_Product::has_attributes() public WC 1.0

Returns whether or not the product has any visible attributes.

{} It's a method of the class: WC_Product{}

No Hooks.

Return

true|false.

Usage

$WC_Product = new WC_Product();
$WC_Product->has_attributes();

Code of WC_Product::has_attributes() WC 5.5.2

<?php
public function has_attributes() {
	foreach ( $this->get_attributes() as $attribute ) {
		if ( $attribute->get_visible() ) {
			return true;
		}
	}
	return false;
}