woocommerce_is_virtual
Checks if a product is virtual (has no shipping).
Usage
add_filter( 'woocommerce_is_virtual', 'wp_kama_woocommerce_is_virtual_filter', 10, 2 ); /** * Function for `woocommerce_is_virtual` filter-hook. * * @param $true === $this->get_virtual * @param $that * * @return */ function wp_kama_woocommerce_is_virtual_filter( $true === $this->get_virtual, $that ){ // filter... return $true === $this->get_virtual; }
- $true === $this->get_virtual
- -
- $that
- -
Where the hook is called
woocommerce_is_virtual
woocommerce/includes/abstracts/abstract-wc-product.php 1593
return apply_filters( 'woocommerce_is_virtual', true === $this->get_virtual(), $this );