PHP Class WC_Shipping_Legacy_Flat_Rate

This class is here for backwards commpatility for methods existing before zones existed.
Deprecation: 2.6.0
Author: WooThemes
Inheritance: extends WC_Shipping_Method
Show file Open project: woocommerce/woocommerce Class Usage Examples

Protected Properties

Property Type Description
$fee_cost cost passed to [fee] shortcode

Public Methods

Method Description
__construct ( ) Constructor.
calc_percentage_adjustment ( float $cost, float $percent_adjustment, string $percent_operator, float $base_price ) : float Calculate the percentage adjustment for each shipping rate.
calculate_extra_shipping ( $method, $rate ) Adds extra calculated flat rates.
calculate_shipping ( array $package = [] ) calculate_shipping function.
fee ( array $atts ) : string Work out fee (shortcode).
find_shipping_classes ( mixed $package ) : array Finds and returns shipping classes and the products with said class.
get_extra_cost ( string $cost_string, string $type, array $package ) : float Get extra cost.
get_option_key ( ) : string Return the name of the option in the WP DB.
get_package_item_qty ( array $package ) : integer Get items in package.
init ( ) init function.
init_form_fields ( ) Initialise Settings Form Fields.
process_admin_options ( ) Process and redirect if disabled.

Protected Methods

Method Description
evaluate_cost ( string $sum, array $args = [] ) : string Evaluate a cost from a sum/string.

Method Details

__construct() public method

Constructor.
public __construct ( )

calc_percentage_adjustment() public method

Calculate the percentage adjustment for each shipping rate.
Deprecation: 2.4.0
public calc_percentage_adjustment ( float $cost, float $percent_adjustment, string $percent_operator, float $base_price ) : float
$cost float
$percent_adjustment float
$percent_operator string
$base_price float
return float

calculate_extra_shipping() public method

Adds extra calculated flat rates.
Deprecation: 2.4.0 Additonal rates defined like this: Option Name | Additional Cost [+- Percents%] | Per Cost Type (order, class, or item).
public calculate_extra_shipping ( $method, $rate )

calculate_shipping() public method

calculate_shipping function.
public calculate_shipping ( array $package = [] )
$package array (default: array())

evaluate_cost() protected method

Evaluate a cost from a sum/string.
protected evaluate_cost ( string $sum, array $args = [] ) : string
$sum string
$args array
return string

fee() public method

Work out fee (shortcode).
public fee ( array $atts ) : string
$atts array
return string

find_shipping_classes() public method

Finds and returns shipping classes and the products with said class.
public find_shipping_classes ( mixed $package ) : array
$package mixed
return array

get_extra_cost() public method

Get extra cost.
Deprecation: 2.4.0
public get_extra_cost ( string $cost_string, string $type, array $package ) : float
$cost_string string
$type string
$package array
return float

get_option_key() public method

Return the name of the option in the WP DB.
Since: 2.6.0
public get_option_key ( ) : string
return string

get_package_item_qty() public method

Get items in package.
public get_package_item_qty ( array $package ) : integer
$package array
return integer

init() public method

init function.
public init ( )

init_form_fields() public method

Initialise Settings Form Fields.
public init_form_fields ( )

process_admin_options() public method

Process and redirect if disabled.

Property Details

$fee_cost protected property

cost passed to [fee] shortcode
protected $fee_cost