프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$availability | string | No longer useful for instance based shipping methods. | |
$countries | array | No longer useful for instance based shipping methods. | |
$enabled | string | yes or no based on whether the method is enabled. | |
$fee | string | Fee for the method (if applicable). | |
$id | string | Unique ID for the shipping method - must be set. | |
$instance_form_fields | array | Instance form fields. | |
$instance_id | integer | Instance ID if used. | |
$instance_settings | array | Instance settings. | |
$method_description | string | Method description. | |
$method_title | string | Method title. | |
$minimum_fee | string | Minimum fee for the method (if applicable). | |
$rates | array | This is an array of rates - methods must populate this array to register shipping costs. | |
$supports | array | - settings Non-instance settings screens. Enabled by default for BW compatibility with methods before instances existed. - instance-settings-modal Allows the instance settings to be loaded within a modal in the zones UI. | |
$tax_status | string | If 'taxable' tax will be charged for this method (if applicable). | |
$title | string | Shipping method title for the frontend. |
메소드 | 설명 | |
---|---|---|
__construct ( integer $instance_id ) | Constructor. | |
add_rate ( array $args = [] ) | Add a shipping rate. If taxes are not set they will be calculated based on cost. | |
admin_options ( ) | Output the shipping settings screen. | |
calculate_shipping ( $package = [] ) | Called to calculate shipping rates for this method. Rates can be added using the add_rate() method. | |
get_admin_options_html ( ) : string | Return admin options as a html string. | |
get_fee ( string | float $fee, float $total ) : float | Get fee to add to shipping cost. | |
get_instance_form_fields ( ) : array | Get settings fields for instances of this shipping method (within zones). | |
get_instance_id ( ) : integer | Return the shipping method instance ID. | |
get_instance_option ( string $key, mixed $empty_value = null ) : mixed | Gets an option from the settings API, using defaults if necessary to prevent undefined notices. | |
get_instance_option_key ( ) : string | Return the name of the option in the WP DB. | |
get_method_description ( ) : string | Return the shipping method description. | |
get_method_title ( ) : string | Return the shipping method title. | |
get_option ( string $key, mixed $empty_value = null ) : mixed | get_option function. | |
get_rate_id ( string $suffix = '' ) : string | Returns a rate ID based on this methods ID and instance, with an optional suffix if distinguishing between multiple rates. | |
get_rates_for_package ( object $package ) : array | Return calculated rates for a package. | |
get_title ( ) : string | Return the shipping title which is user set. | |
has_settings ( ) : boolean | Does this method have a settings page? | |
init_instance_settings ( ) | Initialise Settings for instances. | |
is_available ( array $package ) : boolean | Is this method available? | |
is_enabled ( ) : boolean | Whether or not this method is enabled in settings. | |
is_taxable ( ) : boolean | Whether or not we need to calculate tax on top of the shipping rate. | |
process_admin_options ( ) : boolean | Processes and saves options. | |
supports ( $feature ) : boolean | Check if a shipping method supports a given feature. |
메소드 | 설명 | |
---|---|---|
get_taxes_per_item ( array $costs ) : array | Calc taxes per item being shipping in costs array. |
public calculate_shipping ( $package = [] ) |
public get_admin_options_html ( ) : string | ||
리턴 | string |
public get_instance_form_fields ( ) : array | ||
리턴 | array |
public get_instance_id ( ) : integer | ||
리턴 | integer |
public get_instance_option_key ( ) : string | ||
리턴 | string |
public get_method_description ( ) : string | ||
리턴 | string |
public get_method_title ( ) : string | ||
리턴 | string |
public get_rate_id ( string $suffix = '' ) : string | ||
$suffix | string | |
리턴 | string |
public get_rates_for_package ( object $package ) : array | ||
$package | object | |
리턴 | array |
protected get_taxes_per_item ( array $costs ) : array | ||
$costs | array | |
리턴 | array | of taxes |
public has_settings ( ) : boolean | ||
리턴 | boolean |
public init_instance_settings ( ) |
public is_available ( array $package ) : boolean | ||
$package | array | |
리턴 | boolean |
public is_enabled ( ) : boolean | ||
리턴 | boolean |
public is_taxable ( ) : boolean | ||
리턴 | boolean |
public process_admin_options ( ) : boolean | ||
리턴 | boolean | was anything saved? |
public string $availability | ||
리턴 | string |
public array $countries | ||
리턴 | array |
public string $enabled | ||
리턴 | string |
public string $minimum_fee | ||
리턴 | string |
public array $rates | ||
리턴 | array |
public array $supports | ||
리턴 | array |
public string $tax_status | ||
리턴 | string |