| Server IP : 145.239.37.162 / Your IP : 216.73.217.81 Web Server : Apache System : Linux webm003.cluster130.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : verseaa ( 38250) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/verseaa/www1/wp-content/themes/transpix/woocommerce/includes/ |
Upload File : |
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* WooCommerce Shipping Rate Class.
*
* Simple Class for storing rates.
*
* @class WC_Shipping_Rate
* @version 2.6.0
* @package WooCommerce/Classes/Shipping
* @category Class
* @author WooThemes
*/
class WC_Shipping_Rate {
/** @var string Rate ID. */
public $id = '';
/** @var string Label for the rate. */
public $label = '';
/** @var float Cost for the rate. */
public $cost = 0;
/** @var array Array of taxes for the rate. */
public $taxes = array();
/** @var string Label for the rate. */
public $method_id = '';
/**
* Stores meta data for this rate
* @since 2.6.0
* @var array
*/
private $meta_data = array();
/**
* Constructor.
*
* @param string $id
* @param string $label
* @param integer $cost
* @param array $taxes
* @param string $method_id
*/
public function __construct( $id = '', $label = '', $cost = 0, $taxes = array(), $method_id = '' ) {
$this->id = $id;
$this->label = $label;
$this->cost = $cost;
$this->taxes = ! empty( $taxes ) && is_array( $taxes ) ? $taxes : array();
$this->method_id = $method_id;
}
/**
* Get shipping tax.
*
* @return array
*/
public function get_shipping_tax() {
return apply_filters( 'woocommerce_get_shipping_tax', sizeof( $this->taxes ) > 0 && ! WC()->customer->is_vat_exempt() ? array_sum( $this->taxes ) : 0, $this );
}
/**
* Get label.
*
* @return string
*/
public function get_label() {
return apply_filters( 'woocommerce_shipping_rate_label', $this->label );
}
/**
* Add some meta data for this rate.
* @since 2.6.0
* @param string $key
* @param string $value
*/
public function add_meta_data( $key, $value ) {
$this->meta_data[ wc_clean( $key ) ] = wc_clean( $value );
}
/**
* Get all meta data for this rate.
* @since 2.6.0
*/
public function get_meta_data() {
return $this->meta_data;
}
}