WC_Product::has_attributes()
Returns whether or not the product has any visible attributes.
Метод класса: WC_Product{}
Хуков нет.
Возвращает
true|false
.
Использование
$WC_Product = new WC_Product(); $WC_Product->has_attributes();
Код WC_Product::has_attributes() WC Product::has attributes WC 8.7.0
public function has_attributes() { foreach ( $this->get_attributes() as $attribute ) { if ( $attribute->get_visible() ) { return true; } } return false; }