woocommerce_gzd_template_maybe_hide_shipping_costs

The WooCommerce Germanized woocommerce gzd template maybe hide shipping costs function.

Description

woocommerce_gzd_template_maybe_hide_shipping_costs( $hide, $product ); 

Parameters (2)

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

Usage

  1. if ( !function_exists( 'woocommerce_gzd_template_maybe_hide_shipping_costs' ) ) { 
  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_shipping_costs($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_shipping_costs( $hide, $product ) { 
  2.  
  3. $types = get_option( 'woocommerce_gzd_display_shipping_costs_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. return $hide; 
  13.