wc_gzd_get_tax_rate

The WooCommerce Germanized wc gzd get tax rate function.

Description

wc_gzd_get_tax_rate( $tax_rate_id ); 

Parameters (1)

0. $tax_rate_id
The tax rate id.

Usage

  1. if ( !function_exists( 'wc_gzd_get_tax_rate' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-germanized/includes/wc-gzd-cart-functions.php'; 
  3.  
  4. // The tax rate id. 
  5. $tax_rate_id = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wc_gzd_get_tax_rate($tax_rate_id); 
  9.  

Defined (1)

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

/includes/wc-gzd-cart-functions.php  
  1. function wc_gzd_get_tax_rate( $tax_rate_id ) { 
  2.  
  3. global $wpdb; 
  4.  
  5. $rate = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}woocommerce_tax_rates WHERE tax_rate_id = %d LIMIT 1", $tax_rate_id ) ); 
  6.  
  7. if ( ! empty( $rate ) ) 
  8. return $rate[0]; 
  9.  
  10. return false;