PHP 클래스 WC_Connect_Shipping_Method, woocommerce-connect-client

상속: extends WC_Shipping_Method
파일 보기 프로젝트 열기: Automattic/woocommerce-connect-client 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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