Свойство | Тип | Описание | |
---|---|---|---|
$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. |
public check_cart_items ( ) |
public checkout_form_shipping ( ) |
public create_order ( $data ) : integer | WP_ERROR | ||
$data | Posted data. | |
Результат | integer | WP_ERROR |
protected create_order_coupon_lines ( WC_Order &$order ) | ||
$order | WC_Order |
protected create_order_fee_lines ( WC_Order &$order ) | ||
$order | WC_Order |
protected create_order_line_items ( WC_Order &$order ) | ||
$order | WC_Order |
protected create_order_shipping_lines ( WC_Order &$order ) | ||
$order | WC_Order |
protected create_order_tax_lines ( WC_Order &$order ) | ||
$order | WC_Order |
public get_checkout_fields ( string $fieldset = '' ) : array | ||
$fieldset | string | to get. |
Результат | array |
protected get_posted_data ( ) : array | ||
Результат | array | of data and errors. |
public static instance ( ) : WC_Checkout | ||
Результат | WC_Checkout | Main instance |
public is_registration_enabled ( ) : boolean | ||
Результат | boolean |
public is_registration_required ( ) : boolean | ||
Результат | boolean |
protected maybe_skip_fieldset ( string $fieldset_key, array $data ) | ||
$fieldset_key | string | |
$data | array |
public process_checkout ( ) |
protected process_customer ( array $data ) | ||
$data | array |
protected process_order_payment ( integer $order_id, string $payment_method ) | ||
$order_id | integer | |
$payment_method | string |
protected process_order_without_payment ( integer $order_id ) | ||
$order_id | integer |
protected send_ajax_failure_response ( ) |
protected update_session ( array $data ) | ||
$data | array |
protected validate_checkout ( array &$data, WP_Error &$errors ) | ||
$data | array | An array of posted data. |
$errors | WP_Error |
protected validate_posted_data ( array &$data, WP_Error &$errors ) | ||
$data | array | An array of posted data. |
$errors | WP_Error |
protected static WC_Checkout|null $instance | ||
Результат | WC_Checkout | null |