PHP Class WC_Shipping_Free_Shipping

A simple shipping method for free shipping.
Author: WooThemes
Inheritance: extends WC_Shipping_Method
Show file Open project: woocommerce/woocommerce

Public Properties

Property Type Description
$min_amount integer Min amount to be valid.
$requires string Requires option.

Public Methods

Method Description
__construct ( integer $instance_id ) Constructor.
calculate_shipping ( array $package = [] ) Called to calculate shipping rates for this method. Rates can be added using the add_rate() method.
get_instance_form_fields ( ) : array Get setting form fields for instances of this shipping method within zones.
init ( ) Initialize free shipping.
init_form_fields ( ) Init form fields.
is_available ( array $package ) : boolean See if free shipping is available based on the package and cart.

Method Details

__construct() public method

Constructor.
public __construct ( integer $instance_id )
$instance_id integer Shipping method instance.

calculate_shipping() public method

Called to calculate shipping rates for this method. Rates can be added using the add_rate() method.
public calculate_shipping ( array $package = [] )
$package array Shipping package.

get_instance_form_fields() public method

Get setting form fields for instances of this shipping method within zones.
public get_instance_form_fields ( ) : array
return array

init() public method

Initialize free shipping.
public init ( )

init_form_fields() public method

Init form fields.
public init_form_fields ( )

is_available() public method

See if free shipping is available based on the package and cart.
public is_available ( array $package ) : boolean
$package array Shipping package.
return boolean

Property Details

$min_amount public property

Min amount to be valid.
public int $min_amount
return integer

$requires public property

Requires option.
public string $requires
return string