WC_Product::has_attributes PHP Method

has_attributes() public method

Returns whether or not the product has any visible attributes.
public has_attributes ( ) : boolean
return boolean
    public function has_attributes()
    {
        foreach ($this->get_attributes() as $attribute) {
            if ($attribute->get_visible()) {
                return true;
            }
        }
        return false;
    }
WC_Product