WC_Product::is_purchasable
Returns false if the product cannot be bought.
Метод класса: WC_Product{}
Хуки из метода
Возвращает
bool.
Использование
$WC_Product = new WC_Product(); $WC_Product->is_purchasable();
Код WC_Product::is_purchasable() WC Product::is purchasable WC 11.1.2
public function is_purchasable() {
/**
* Filters whether a product is purchasable.
*
* @since 2.7.0
* @param bool $purchasable Whether the product is purchasable.
* @param WC_Product $product Product object.
*/
return apply_filters( 'woocommerce_is_purchasable', $this->exists() && $this->is_viewable() && '' !== $this->get_price(), $this );
}