wc_correios_normalize_price

Fix Correios prices.

Description

(string) wc_correios_normalize_price( (string) $value ); 

Returns (string)

Parameters (1)

0. $value (string)
Value to fix.

Usage

  1. if ( !function_exists( 'wc_correios_normalize_price' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-correios/includes/wc-correios-functions.php'; 
  3.  
  4. // Value to fix. 
  5. $value = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wc_correios_normalize_price($value); 
  9.  

Defined (1)

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

/includes/wc-correios-functions.php  
  1. function wc_correios_normalize_price( $value ) { 
  2. $value = str_replace( '.', '', $value ); 
  3. $value = str_replace( ', ', '.', $value ); 
  4.  
  5. return $value;