woocommerce_is_purchasable

woocommerce_is_purchasable

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.9.5.2

apply_filters('woocommerce_is_purchasable') is found 3 times:

  • /includes/abstracts/abstract-wc-product.php line 1661
    1657
    1658
    1659
    1660
    1661
    1662
    1663
    1664
    1665
    1666
    1667
    *
     * @return bool
     */
    public function is_purchasable() {
        return apply_filters( 'woocommerce_is_purchasable', $this->exists() && ( 'publish' === $this->get_status() || current_user_can( 'edit_post', $this->get_id() ) ) && '' !== $this->get_price(), $this );
    }
     
    /**
     * Returns whether or not the product is on sale.
     *
     * @param  string $context What the value is for. Valid values are view and edit.
  • /includes/class-wc-product-external.php line 151
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    * @access public
     * @return bool
     */
    public function is_purchasable() {
        return apply_filters( 'woocommerce_is_purchasable', false, $this );
    }
     
    /**
     * Get the add to url used mainly in loops.
     *
     * @access public
  • /includes/class-wc-product-grouped.php line 82
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    *
     * @return bool
     */
    public function is_purchasable() {
        return apply_filters( 'woocommerce_is_purchasable', false, $this );
    }
     
    /**
     * Returns the price in html format.
     *
     * @param string $price (default: '').

See this hook used in plugins:

Examples using woocommerce_is_purchasable