PHP Класс WC_Connect_Shipping_Method, woocommerce-connect-client

Наследование: extends WC_Shipping_Method
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$api_client WC_Connect_API_Client
$logger WC_Connect_Logger
$service_schema A reference to a the fetched properties of the service
$service_settings_store WC_Connect_Service_Settings_Store

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

Метод Описание
__construct ( $id_or_instance_id = null )
admin_options ( )
calculate_shipping ( $package = [] )
format_rate_id ( $method_id, $instance, $rate_idx )
format_rate_title ( $rate_title )
get_api_client ( )
get_logger ( )
get_service_schema ( )
get_service_settings ( ) : object Returns the settings for this service (e.g. for use in the form or for sending to the rate request endpoint
get_service_settings_store ( )
is_valid_package_destination ( array $package ) : boolean Determine if a package's destination is valid enough for a rate quote.
set_api_client ( WC_Connect_API_Client $api_client )
set_last_request_failed ( $timestamp = null )
set_logger ( WC_Connect_Logger $logger )
set_service_schema ( $service_schema )
set_service_settings_store ( $service_settings_store )
update_last_rate_request_timestamp ( )

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

Метод Описание
init_form_settings ( ) Restores any values persisted to the DB for this service instance and sets up title for WC core to work properly
log ( string | WP_Error $message, string $context = '' ) Logging helper.

Приватные методы

Метод Описание
lookup_product ( $package, $product_id )

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

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

public __construct ( $id_or_instance_id = null )

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

public admin_options ( )

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

public calculate_shipping ( $package = [] )

format_rate_id() публичный статический Метод

public static format_rate_id ( $method_id, $instance, $rate_idx )

format_rate_title() публичный статический Метод

public static format_rate_title ( $rate_title )

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

public get_api_client ( )

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

public get_logger ( )

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

public get_service_schema ( )

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

Used by WC_Connect_Loader to embed the form schema in the page for JS to consume
public get_service_settings ( ) : object
Результат object

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

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

Restores any values persisted to the DB for this service instance and sets up title for WC core to work properly
protected init_form_settings ( )

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

Determine if a package's destination is valid enough for a rate quote.
public is_valid_package_destination ( array $package ) : boolean
$package array
Результат boolean

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

Avoids calling methods on an undefined object if no logger was injected during the init action in the constructor.
См. также: WC_Connect_Logger::log()
protected log ( string | WP_Error $message, string $context = '' )
$message string | WP_Error
$context string

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

public set_api_client ( WC_Connect_API_Client $api_client )
$api_client WC_Connect_API_Client

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

public set_last_request_failed ( $timestamp = null )

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

public set_logger ( WC_Connect_Logger $logger )
$logger WC_Connect_Logger

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

public set_service_schema ( $service_schema )

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

public set_service_settings_store ( $service_settings_store )

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

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

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

protected WC_Connect_API_Client $api_client
Результат WC_Connect_API_Client

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

protected WC_Connect_Logger $logger
Результат WC_Connect_Logger

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

A reference to a the fetched properties of the service
protected $service_schema

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

protected WC_Connect_Service_Settings_Store $service_settings_store
Результат WC_Connect_Service_Settings_Store