woocommerce_product_is_on_sale

woocommerce_product_is_on_sale

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

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

apply_filters('woocommerce_product_is_on_sale') is found 3 times:

  • /includes/abstracts/abstract-wc-product.php line 1647
    			}
    		} 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 73
    				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 509
    	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