wc_correios_get_estimating_delivery

Get estimating delivery description.

Description

(string) wc_correios_get_estimating_delivery( (string) $name, (string) $days, (int) $additional_days = 0 ); 

Returns (string)

Parameters (3)

0. $name (string)
Shipping name.
1. $days (string)
Estimated days to accomplish delivery.
2. $additional_days — Optional. (int)
The additional days.

Usage

  1. if ( !function_exists( 'wc_correios_get_estimating_delivery' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-correios/includes/wc-correios-functions.php'; 
  3.  
  4. // Shipping name. 
  5. $name = ''; 
  6.  
  7. // Estimated days to accomplish delivery. 
  8. $days = ''; 
  9.  
  10. // The additional days. 
  11. $additional_days = -1; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = wc_correios_get_estimating_delivery($name, $days, $additional_days); 
  15.  

Defined (1)

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

/includes/wc-correios-functions.php  
  1. function wc_correios_get_estimating_delivery( $name, $days, $additional_days = 0 ) { 
  2. $total = intval( $days ) + intval( $additional_days ); 
  3.  
  4. if ( $total > 0 ) { 
  5. $name .= ' (' . sprintf( _n( 'Delivery within %d working day', 'Delivery within %d working days', $total, 'woocommerce-correios' ), $total ) . ')'; 
  6.  
  7. return apply_filters( 'woocommerce_correios_get_estimating_delivery', $name, $days, $additional_days );