woocommerce_gzd_template_sale_price_label_html

The WordPress Core woocommerce gzd template sale price label html function.

Description

woocommerce_gzd_template_sale_price_label_html( $price, $product ); 

Parameters (2)

0. $price
The price.
1. $product
The product.

Usage

  1. if ( !function_exists( 'woocommerce_gzd_template_sale_price_label_html' ) ) { 
  2. require_once '/includes/wc-gzd-template-functions.php'; 
  3.  
  4. // The price. 
  5. $price = null; 
  6.  
  7. // The product. 
  8. $product = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = woocommerce_gzd_template_sale_price_label_html($price, $product); 
  12.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-gzd-template-functions.php  
  1. function woocommerce_gzd_template_sale_price_label_html( $price, $product ) { 
  2.  
  3. if ( ! is_product() && get_option( 'woocommerce_gzd_display_listings_sale_price_labels' ) === 'no' ) 
  4. return $price; 
  5. elseif ( is_product() && get_option( 'woocommerce_gzd_display_product_detail_sale_price_labels' ) === 'no' ) 
  6. return $price; 
  7.  
  8. return wc_gzd_get_gzd_product( $product )->add_labels_to_price_html( $price );