PHP 클래스 WC_Checkout

The WooCommerce checkout class handles the checkout process, collecting user data and processing the payment.
저자: WooThemes
파일 보기 프로젝트 열기: woocommerce/woocommerce 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$fields array | null Checkout fields are stored here.
$instance WC_Checkout | null The single instance of the class.

공개 메소드들

메소드 설명
__clone ( ) Cloning is forbidden.
__get ( string $key ) : string Gets the legacy public variables for backwards compatibility.
__isset ( string $key ) : boolean See if variable is set. Used to support legacy public variables which are no longer defined.
__set ( string $key, mixed $value ) Sets the legacy public variables for backwards compatibility.
__wakeup ( ) Unserializing instances of this class is forbidden.
check_cart_items ( ) When we process the checkout, lets ensure cart items are rechecked to prevent checkout.
checkout_form_billing ( ) Output the billing form.
checkout_form_shipping ( ) Output the shipping form.
create_order ( $data ) : integer | WP_ERROR Create an order. Error codes: 520 - Cannot insert order into the database.
get_checkout_fields ( string $fieldset = '' ) : array Get an array of checkout fields.
get_posted_address_data ( string $key, string $type = 'billing' ) : string Get a posted address field after sanitization and validation.
get_value ( string $input ) : string | null Gets the value either from the posted data, or from the users meta data.
instance ( ) : WC_Checkout Gets the main WC_Checkout Instance.
is_registration_enabled ( ) : boolean Is registration enabled on the checkout page?
is_registration_required ( ) : boolean Is registration required to checkout?
process_checkout ( ) Process the checkout after the confirm order button is pressed.

보호된 메소드들

메소드 설명
create_order_coupon_lines ( WC_Order &$order ) Add coupon lines to the order.
create_order_fee_lines ( WC_Order &$order ) Add fees to the order.
create_order_line_items ( WC_Order &$order ) Add line items to the order.
create_order_shipping_lines ( WC_Order &$order ) Add shipping lines to the order.
create_order_tax_lines ( WC_Order &$order ) Add tax lines to the order.
get_posted_data ( ) : array Get posted data from the checkout form.
maybe_skip_fieldset ( string $fieldset_key, array $data ) See if a fieldset should be skipped.
process_customer ( array $data ) Create a new customer account if needed.
process_order_payment ( integer $order_id, string $payment_method ) Process an order that does require payment.
process_order_without_payment ( integer $order_id ) Process an order that doesn't require payment.
send_ajax_failure_response ( ) If checkout failed during an AJAX call, send failure response.
update_session ( array $data ) Update customer and session data from the posted checkout data.
validate_checkout ( array &$data, WP_Error &$errors ) Validates that the checkout has enough info to proceed.
validate_posted_data ( array &$data, WP_Error &$errors ) Validates the posted checkout data based on field properties.

메소드 상세

__clone() 공개 메소드

Cloning is forbidden.
public __clone ( )

__get() 공개 메소드

Gets the legacy public variables for backwards compatibility.
public __get ( string $key ) : string
$key string
리턴 string

__isset() 공개 메소드

See if variable is set. Used to support legacy public variables which are no longer defined.
public __isset ( string $key ) : boolean
$key string
리턴 boolean

__set() 공개 메소드

Sets the legacy public variables for backwards compatibility.
public __set ( string $key, mixed $value )
$key string
$value mixed

__wakeup() 공개 메소드

Unserializing instances of this class is forbidden.
public __wakeup ( )

check_cart_items() 공개 메소드

When we process the checkout, lets ensure cart items are rechecked to prevent checkout.
public check_cart_items ( )

checkout_form_billing() 공개 메소드

Output the billing form.

checkout_form_shipping() 공개 메소드

Output the shipping form.

create_order() 공개 메소드

521 - Cannot get order after creation. 522 - Cannot update order. 525 - Cannot create line item. 526 - Cannot create fee item. 527 - Cannot create shipping item. 528 - Cannot create tax item. 529 - Cannot create coupon item.
public create_order ( $data ) : integer | WP_ERROR
$data Posted data.
리턴 integer | WP_ERROR

create_order_coupon_lines() 보호된 메소드

Add coupon lines to the order.
protected create_order_coupon_lines ( WC_Order &$order )
$order WC_Order

create_order_fee_lines() 보호된 메소드

Add fees to the order.
protected create_order_fee_lines ( WC_Order &$order )
$order WC_Order

create_order_line_items() 보호된 메소드

Add line items to the order.
protected create_order_line_items ( WC_Order &$order )
$order WC_Order

create_order_shipping_lines() 보호된 메소드

Add shipping lines to the order.
protected create_order_shipping_lines ( WC_Order &$order )
$order WC_Order

create_order_tax_lines() 보호된 메소드

Add tax lines to the order.
protected create_order_tax_lines ( WC_Order &$order )
$order WC_Order

get_checkout_fields() 공개 메소드

Get an array of checkout fields.
public get_checkout_fields ( string $fieldset = '' ) : array
$fieldset string to get.
리턴 array

get_posted_address_data() 공개 메소드

Get a posted address field after sanitization and validation.
public get_posted_address_data ( string $key, string $type = 'billing' ) : string
$key string
$type string billing for shipping
리턴 string

get_posted_data() 보호된 메소드

Get posted data from the checkout form.
부터: 2.7.0
protected get_posted_data ( ) : array
리턴 array of data and errors.

get_value() 공개 메소드

Gets the value either from the posted data, or from the users meta data.
public get_value ( string $input ) : string | null
$input string
리턴 string | null

instance() 공개 정적인 메소드

Gets the main WC_Checkout Instance.
부터: 2.1
public static instance ( ) : WC_Checkout
리턴 WC_Checkout Main instance

is_registration_enabled() 공개 메소드

Is registration enabled on the checkout page?
부터: 2.7.0

is_registration_required() 공개 메소드

Is registration required to checkout?
부터: 2.7.0

maybe_skip_fieldset() 보호된 메소드

See if a fieldset should be skipped.
부터: 2.7.0
protected maybe_skip_fieldset ( string $fieldset_key, array $data )
$fieldset_key string
$data array

process_checkout() 공개 메소드

Process the checkout after the confirm order button is pressed.
public process_checkout ( )

process_customer() 보호된 메소드

Create a new customer account if needed.
protected process_customer ( array $data )
$data array

process_order_payment() 보호된 메소드

Process an order that does require payment.
부터: 2.7.0
protected process_order_payment ( integer $order_id, string $payment_method )
$order_id integer
$payment_method string

process_order_without_payment() 보호된 메소드

Process an order that doesn't require payment.
부터: 2.7.0
protected process_order_without_payment ( integer $order_id )
$order_id integer

send_ajax_failure_response() 보호된 메소드

If checkout failed during an AJAX call, send failure response.

update_session() 보호된 메소드

Update customer and session data from the posted checkout data.
부터: 2.7.0
protected update_session ( array $data )
$data array

validate_checkout() 보호된 메소드

Validates that the checkout has enough info to proceed.
부터: 2.7.0
protected validate_checkout ( array &$data, WP_Error &$errors )
$data array An array of posted data.
$errors WP_Error

validate_posted_data() 보호된 메소드

Validates the posted checkout data based on field properties.
부터: 2.7.0
protected validate_posted_data ( array &$data, WP_Error &$errors )
$data array An array of posted data.
$errors WP_Error

프로퍼티 상세

$fields 보호되어 있는 프로퍼티

Checkout fields are stored here.
protected array|null $fields
리턴 array | null

$instance 보호되어 있는 정적으로 프로퍼티

The single instance of the class.
protected static WC_Checkout|null $instance
리턴 WC_Checkout | null