WooCommerce extends Component
Implements integration with WooCommerce.
Table of Contents
- $objects : array<string|int, mixed>
- WooCommerce objects.
- __construct() : mixed
- Class constructor.
- alter_account_menu() : array<string|int, mixed>
- Alters account menu.
- alter_account_page() : array<string|int, mixed>
- Alters account page.
- format_cart_item_meta() : array<string|int, mixed>
- Formats cart item meta.
- format_order_item_meta() : array<string|int, mixed>
- Formats order item meta.
- format_price() : string
- Formats price.
- get_config() : array<string|int, mixed>
- Gets WooCommerce configuration.
- get_order_product_ids() : array<string|int, mixed>
- Gets order product IDs.
- get_product_price_text() : string
- Gets product price text.
- get_related_product() : object
- Gets related product.
- redirect_pages() : mixed
- Redirects pages.
- set_account_template() : string
- Sets account page template.
- set_countries() : array<string|int, mixed>
- Sets countries configuration.
- set_order_item_meta() : mixed
- Sets order item meta.
- set_request_context() : array<string|int, mixed>
- Sets request context.
- update_options() : mixed
- Updates options.
- update_order_status() : mixed
- Updates order status.
- update_user_billing_name() : mixed
- Updates user billing name.
- boot() : mixed
- Bootstraps component properties.
- get_item_meta_fields() : array<string|int, mixed>
- Gets item meta fields.
- set_callbacks() : mixed
- Sets the action and filter callbacks.
- set_property() : mixed
- Sets a property value.
Properties
$objects
WooCommerce objects.
protected
array<string|int, mixed>
$objects
= []
Methods
__construct()
Class constructor.
public
__construct([array<string|int, mixed> $args = [] ]) : mixed
Parameters
- $args : array<string|int, mixed> = []
-
Component arguments.
Return values
mixed —alter_account_menu()
Alters account menu.
public
alter_account_menu(array<string|int, mixed> $menu) : array<string|int, mixed>
Parameters
- $menu : array<string|int, mixed>
-
Menu arguments.
Return values
array<string|int, mixed> —alter_account_page()
Alters account page.
public
alter_account_page(array<string|int, mixed> $template) : array<string|int, mixed>
Parameters
- $template : array<string|int, mixed>
-
Template arguments.
Return values
array<string|int, mixed> —format_cart_item_meta()
Formats cart item meta.
public
format_cart_item_meta(array<string|int, mixed> $meta, array<string|int, mixed> $cart_item) : array<string|int, mixed>
Parameters
- $meta : array<string|int, mixed>
-
Meta values.
- $cart_item : array<string|int, mixed>
-
Cart item.
Return values
array<string|int, mixed> —format_order_item_meta()
Formats order item meta.
public
format_order_item_meta(array<string|int, mixed> $meta) : array<string|int, mixed>
Parameters
- $meta : array<string|int, mixed>
-
Meta values.
Return values
array<string|int, mixed> —format_price()
Formats price.
public
format_price(float $price) : string
Parameters
- $price : float
-
Price.
Return values
string —get_config()
Gets WooCommerce configuration.
public
get_config(string $name) : array<string|int, mixed>
Parameters
- $name : string
-
Configuration name.
Return values
array<string|int, mixed> —get_order_product_ids()
Gets order product IDs.
public
get_order_product_ids(WC_Order $order) : array<string|int, mixed>
Parameters
- $order : WC_Order
-
Order object.
Return values
array<string|int, mixed> —get_product_price_text()
Gets product price text.
public
get_product_price_text(WC_Product $product) : string
Parameters
- $product : WC_Product
-
Product object.
Return values
string —get_related_product()
Gets related product.
public
get_related_product(int $parent_id[, array<string|int, mixed> $args = [] ]) : object
Parameters
- $parent_id : int
-
Parent ID.
- $args : array<string|int, mixed> = []
-
Query arguments.
Return values
object —redirect_pages()
Redirects pages.
public
redirect_pages() : mixed
Return values
mixed —set_account_template()
Sets account page template.
public
set_account_template(string $path, string $name) : string
Parameters
- $path : string
-
Template filepath.
- $name : string
-
Template name.
Return values
string —set_countries()
Sets countries configuration.
public
set_countries(array<string|int, mixed> $countries) : array<string|int, mixed>
Parameters
- $countries : array<string|int, mixed>
-
Countries array.
Return values
array<string|int, mixed> —set_order_item_meta()
Sets order item meta.
public
set_order_item_meta(WC_Order_Item_Product $item, string $cart_item_key, array<string|int, mixed> $meta) : mixed
Parameters
- $item : WC_Order_Item_Product
-
Order item.
- $cart_item_key : string
-
Cart item key.
- $meta : array<string|int, mixed>
-
Meta values.
Return values
mixed —set_request_context()
Sets request context.
public
set_request_context(array<string|int, mixed> $context) : array<string|int, mixed>
Parameters
- $context : array<string|int, mixed>
-
Request context.
Return values
array<string|int, mixed> —update_options()
Updates options.
public
update_options() : mixed
Return values
mixed —update_order_status()
Updates order status.
public
update_order_status(int $order_id, string $old_status, string $new_status, WC_Order $order) : mixed
Parameters
- $order_id : int
-
Order ID.
- $old_status : string
-
Old status.
- $new_status : string
-
New status.
- $order : WC_Order
-
Order object.
Return values
mixed —update_user_billing_name()
Updates user billing name.
public
update_user_billing_name(int $user_id, string $value) : mixed
Parameters
- $user_id : int
-
User ID.
- $value : string
-
Value.
Return values
mixed —boot()
Bootstraps component properties.
protected
boot() : mixed
Return values
mixed —get_item_meta_fields()
Gets item meta fields.
protected
get_item_meta_fields() : array<string|int, mixed>
Return values
array<string|int, mixed> —set_callbacks()
Sets the action and filter callbacks.
protected
final set_callbacks(array<string|int, mixed> $callbacks) : mixed
Parameters
- $callbacks : array<string|int, mixed>
-
Callback arguments.
Return values
mixed —set_property()
Sets a property value.
protected
final set_property(string $name, mixed $value[, string $prefix = '' ]) : mixed
Parameters
- $name : string
-
Property name.
- $value : mixed
-
Property value.
- $prefix : string = ''
-
Method prefix.