woocommerce_gzd_template_maybe_hide_delivery_time

The WooCommerce Germanized woocommerce gzd template maybe hide delivery time function.

Description

woocommerce_gzd_template_maybe_hide_delivery_time( $hide, $product ); 

Parameters (2)

0. $hide
The hide.
1. $product
The product.

Usage

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

Defined (1)

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

/includes/wc-gzd-template-functions.php  
  1. function woocommerce_gzd_template_maybe_hide_delivery_time( $hide, $product ) { 
  2.  
  3. $types = get_option( 'woocommerce_gzd_display_delivery_time_hidden_types', array() ); 
  4.  
  5. if ( is_array( $types ) ) { 
  6.  
  7. foreach ( $types as $type ) { 
  8.  
  9. if ( wc_gzd_product_matches_extended_type( $type, $product ) ) 
  10. return true; 
  11.  
  12. // Hide delivery time if product is not in stock 
  13. if ( ! $product->is_in_stock() ) 
  14. return true; 
  15.  
  16. return $hide; 
  17.