PHP Класс WC_Shipping_Legacy_Flat_Rate

This class is here for backwards commpatility for methods existing before zones existed.
Устаревший: 2.6.0
Автор: WooThemes
Наследование: extends WC_Shipping_Method
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$fee_cost cost passed to [fee] shortcode

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
evaluate_cost ( string $sum, array $args = [] ) : string Evaluate a cost from a sum/string.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( )

calc_percentage_adjustment() публичный Метод

Calculate the percentage adjustment for each shipping rate.
Устаревший: 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
Результат float

calculate_extra_shipping() публичный Метод

Adds extra calculated flat rates.
Устаревший: 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() публичный Метод

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

evaluate_cost() защищенный Метод

Evaluate a cost from a sum/string.
protected evaluate_cost ( string $sum, array $args = [] ) : string
$sum string
$args array
Результат string

fee() публичный Метод

Work out fee (shortcode).
public fee ( array $atts ) : string
$atts array
Результат string

find_shipping_classes() публичный Метод

Finds and returns shipping classes and the products with said class.
public find_shipping_classes ( mixed $package ) : array
$package mixed
Результат array

get_extra_cost() публичный Метод

Get extra cost.
Устаревший: 2.4.0
public get_extra_cost ( string $cost_string, string $type, array $package ) : float
$cost_string string
$type string
$package array
Результат float

get_option_key() публичный Метод

Return the name of the option in the WP DB.
С версии: 2.6.0
public get_option_key ( ) : string
Результат string

get_package_item_qty() публичный Метод

Get items in package.
public get_package_item_qty ( array $package ) : integer
$package array
Результат integer

init() публичный Метод

init function.
public init ( )

init_form_fields() публичный Метод

Initialise Settings Form Fields.
public init_form_fields ( )

process_admin_options() публичный Метод

Process and redirect if disabled.

Описание свойств

$fee_cost защищенное свойство

cost passed to [fee] shortcode
protected $fee_cost