Class WC_Shipping_Method

WooCommerce Shipping Method Class

Extended by shipping methods to handle shipping calculations etc.

WC_Settings_API
Extended by WC_Shipping_Method

Direct known subclasses

WC_Shipping_Flat_Rate, WC_Shipping_Free_Shipping, WC_Shipping_Local_Delivery, WC_Shipping_Local_Pickup

Indirect known subclasses

WC_Shipping_International_Delivery

Abstract
Package: WooCommerce\Abstracts
Category: Abstract Class
Author: WooThemes
Version: 1.6.4
Class: WC_Shipping_Method
Located at includes/abstracts/abstract-wc-shipping-method.php

Methods summary

public boolean
# is_taxable( )

Whether or not we need to calculate tax on top of the shipping rate

Whether or not we need to calculate tax on top of the shipping rate

Returns

boolean
public
# add_rate( array $args = array() )

Add a rate

Add a rate

Add a shipping rate. If taxes are not set they will be calculated based on cost.

Parameters

$args
array
$args (default: array())
public boolean
# has_settings( )

has_settings function.

has_settings function.

Returns

boolean
public boolean
# is_available( array $package )

is_available function.

is_available function.

Parameters

$package
array
$package

Returns

boolean
public string
# get_title( )

Return the gateways title

Return the gateways title

Returns

string
public float
# get_fee( mixed $fee, mixed $total )

get_fee function.

get_fee function.

Parameters

$fee
mixed
$fee
$total
mixed
$total

Returns

float
public boolean
# supports( mixed $feature )

Check if a shipping method supports a given feature.

Check if a shipping method supports a given feature.

Methods should override this to declare support (or lack of support) for a feature.

Parameters

$feature
mixed
$feature string The name of a feature to test support for.

Returns

boolean
True if the gateway supports the feature, false otherwise.

Since

1.5.7

Methods inherited from WC_Settings_API

admin_options(), display_errors(), format_settings(), generate_checkbox_html(), generate_decimal_html(), generate_multiselect_html(), generate_password_html(), generate_price_html(), generate_select_html(), generate_settings_html(), generate_text_html(), generate_textarea_html(), generate_title_html(), get_custom_attribute_html(), get_description_html(), get_form_fields(), get_option(), get_tooltip_html(), init_form_fields(), init_settings(), process_admin_options(), validate_checkbox_field(), validate_decimal_field(), validate_multiselect_field(), validate_password_field(), validate_price_field(), validate_select_field(), validate_settings_fields(), validate_text_field(), validate_textarea_field()

Magic methods summary

Properties summary

public string $id
#

Unique ID for the shipping method - must be set.

Unique ID for the shipping method - must be set.

public integer $number
#

Optional instance ID.

Optional instance ID.

public string $method_title
#

Method title

Method title

public string $title
#

User set title

User set title

public boolean $availability
#

True if the method is available.

True if the method is available.

public array $countries
#

Array of countries this method is enabled for.

Array of countries this method is enabled for.

public string $tax_status
#

If 'taxable' tax will be charged for this method (if applicable)

If 'taxable' tax will be charged for this method (if applicable)

public mixed $fee
#

Fees for the method

Fees for the method

public float $minimum_fee
#

Minimum fee for the method

Minimum fee for the method

public boolean $enabled
#

Enabled for disabled

Enabled for disabled

public boolean $has_settings
#

Whether the method has settings or not (In WooCommerce > Settings > Shipping)

Whether the method has settings or not (In WooCommerce > Settings > Shipping)

public array $supports
#

Features this method supports.

Features this method supports.

public array $rates
#

This is an array of rates - methods must populate this array to register shipping costs

This is an array of rates - methods must populate this array to register shipping costs

Properties inherited from WC_Settings_API

$errors, $form_fields, $plugin_id, $sanitized_fields, $settings

WooCommerce API documentation generated by ApiGen 2.8.0