woocommerce_variation_is_purchasable

woocommerce_variation_is_purchasable

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_variation_is_purchasable') is found 1 times:

  • /includes/class-wc-product-variation.php line 562
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
         * @since 3.0.0
         * @param bool $purchasable If the variation is purchasable.
         * @param object $variation The variation object.
         */
        return apply_filters( 'woocommerce_variation_is_purchasable', $this->variation_is_visible() && parent::is_purchasable() && ( ProductStatus::PUBLISH === $this->parent_data['status'] || current_user_can( 'edit_post', $this->get_parent_id() ) ), $this );
    }
     
    /**
     * Controls whether this particular variation will appear greyed-out (inactive) or not (active).
     * Used by extensions to make incompatible variations appear greyed-out, etc.
     * Other possible uses: prevent out-of-stock variations from being selected.