WC_Abstract_Legacy_Product::has_all_attributes_set()publicWC 1.0

Deprecated from version 3.0.0. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.

Check if all variation's attributes are set.

Method of the class: WC_Abstract_Legacy_Product{}

No Hooks.

Return

true|false.

Usage

$WC_Abstract_Legacy_Product = new WC_Abstract_Legacy_Product();
$WC_Abstract_Legacy_Product->has_all_attributes_set();

Changelog

Deprecated since 3.0.0

WC_Abstract_Legacy_Product::has_all_attributes_set() code WC 7.7.0

public function has_all_attributes_set() {
	wc_deprecated_function( 'WC_Product::has_all_attributes_set', '3.0', 'an array filter on get_variation_attributes for a quick solution.' );
	$set = true;

	// undefined attributes have null strings as array values
	foreach ( $this->get_variation_attributes() as $att ) {
		if ( ! $att ) {
			$set = false;
			break;
		}
	}
	return $set;
}