WC_Correios_Shipping_SEDEX

SEDEX shipping method class.

Defined (1)

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

/includes/shipping/class-wc-correios-shipping-sedex.php  
  1. class WC_Correios_Shipping_SEDEX extends WC_Correios_Shipping { 
  2.  
  3. /** 
  4. * Service code. 
  5. * 04014 - SEDEX without contract. 
  6. * @var string 
  7. */ 
  8. protected $code = '04014'; 
  9.  
  10. /** 
  11. * Corporate code. 
  12. * 04162 - SEDEX with contract. 
  13. * @var string 
  14. */ 
  15. protected $corporate_code = '04162'; 
  16.  
  17. /** 
  18. * Initialize SEDEX. 
  19. * @param int $instance_id Shipping zone instance. 
  20. */ 
  21. public function __construct( $instance_id = 0 ) { 
  22. $this->id = 'correios-sedex'; 
  23. $this->method_title = __( 'SEDEX', 'woocommerce-correios' ); 
  24. $this->more_link = 'http://www.correios.com.br/para-voce/correios-de-a-a-z/sedex'; 
  25.  
  26. parent::__construct( $instance_id ); 
  27.  
  28. /** 
  29. * Get the declared value from the package. 
  30. * @param array $package Cart package. 
  31. * @return float 
  32. */ 
  33. protected function get_declared_value( $package ) { 
  34. if ( 16 >= $package['contents_cost'] ) { 
  35. return 0; 
  36.  
  37. return $package['contents_cost'];