woocommerce_product_is_on_sale, $on_sale, $this
woocommerce_product_is_on_sale, $on_sale, $this
Appears in: woocommerce.11.0.0
Hook Type: filter
Displaying hooks found in version: woocommerce.11.0.0apply_filters('woocommerce_product_is_on_sale, $on_sale, $this') is found 3 times:
- /includes/abstracts/abstract-wc-product.php line 1791
} } else { $on_sale = false; } return 'view' === $context ? apply_filters( 'woocommerce_product_is_on_sale', $on_sale, $this ) : $on_sale; } /** * Returns whether or not the product has dimensions set. * * @return bool - /includes/class-wc-product-grouped.php line 76
break; } } return 'view' === $context ? apply_filters( 'woocommerce_product_is_on_sale', $on_sale, $this ) : $on_sale; } /** * Returns false if the product cannot be bought. * * @return bool
- /includes/class-wc-product-variable.php line 596
public function is_on_sale( $context = 'view' ) { $prices = $this->get_variation_prices(); $on_sale = $prices['regular_price'] !== $prices['sale_price'] && $prices['sale_price'] === $prices['price']; return 'view' === $context ? apply_filters( 'woocommerce_product_is_on_sale', $on_sale, $this ) : $on_sale; } /** * Is a child in stock? * * @return boolean