fee

The WooCommerce fee shortcode.


Usage

  1. // basic usage 
  2. echo do_shortcode('[fee]'); 
  1. // variable usage 
  2. $result = do_shortcode('[fee]'); 
  3. echo $result;  

Defined (4)

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

/includes/shipping/flat-rate/class-wc-shipping-flat-rate.php  
  1. $locale = localeconv(); 
  2. $decimals = array( wc_get_price_decimal_separator(), $locale['decimal_point'], $locale['mon_decimal_point'], ', ' ); 
  3. $this->fee_cost = $args['cost']; 
  4.  
  5. // Expand shortcodes 
  6. add_shortcode( 'fee', array( $this, 'fee' ) ); 
  7.  
  8. $sum = do_shortcode( str_replace( 
  9. array( 
  10. '[qty]',  
  11. '[cost]',  
  1. $args['cost'],  
  2. ),  
  3. $sum 
  4. ) ); 
  5.  
  6. remove_shortcode( 'fee', array( $this, 'fee' ) ); 
  7.  
  8. // Remove whitespace from string 
  9. $sum = preg_replace( '/\s+/', '', $sum ); 
  10.  
  11. // Remove locale from string 
/includes/shipping/legacy-flat-rate/class-wc-shipping-legacy-flat-rate.php  
  1. $decimals = array( wc_get_price_decimal_separator(), $locale['decimal_point'], $locale['mon_decimal_point'] ); 
  2.  
  3. $this->fee_cost = $args['cost']; 
  4.  
  5. // Expand shortcodes 
  6. add_shortcode( 'fee', array( $this, 'fee' ) ); 
  7.  
  8. $sum = do_shortcode( str_replace( 
  9. array( 
  10. '[qty]',  
  11. '[cost]',  
  1. $args['cost'],  
  2. ),  
  3. $sum 
  4. ) ); 
  5.  
  6. remove_shortcode( 'fee', array( $this, 'fee' ) ); 
  7.  
  8. // Remove whitespace from string 
  9. $sum = preg_replace( '/\s+/', '', $sum ); 
  10.  
  11. // Remove locale from string