WordPress at Your Fingertips
function is not described

WC_Product_Variation::is_purchasable() public WC 1.0

Returns false if the product cannot be bought. Override abstract method so that: i) Disabled variations are not be purchasable by admins. ii) Enabled variations are not purchasable if the parent product is not purchasable.

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

Hooks from the method



$WC_Product_Variation = new WC_Product_Variation();

Code of WC_Product_Variation::is_purchasable() WC 5.7.0

public function is_purchasable() {
	return apply_filters( 'woocommerce_variation_is_purchasable', $this->variation_is_visible() && parent::is_purchasable() && ( 'publish' === $this->parent_data['status'] || current_user_can( 'edit_post', $this->get_parent_id() ) ), $this );