PHP Класс WooCommerce

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

Открытые свойства

Свойство Тип Описание
$cart WC_Cart Cart instance.
$countries WC_Countries Countries instance.
$customer WC_Customer Customer instance.
$integrations WC_Integrations Integrations instance.
$order_factory WC_Order_Factory Order factory instance.
$product_factory WC_Product_Factory Product factory instance.
$query WC_Query Query instance.
$session WC_Session Session instance.
$structured_data WC_Structured_Data Structured data instance.
$version string WooCommerce version.

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

Свойство Тип Описание
$_instance WooCommerce The single instance of the class.

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

Метод Описание
__clone ( ) Cloning is forbidden.
__construct ( ) WooCommerce Constructor.
__get ( mixed $key ) : mixed Auto-load in-accessible properties on demand.
__wakeup ( ) Unserializing instances of this class is forbidden.
ajax_url ( ) : string Get Ajax URL.
api_request_url ( string $request, mixed $ssl = null ) : string Return the WC API URL for a given request.
checkout ( ) : WC_Checkout Get Checkout Class.
frontend_includes ( ) Include required frontend files.
include_template_functions ( ) Function used to Init WooCommerce Template Functions - This makes them pluggable by plugins and themes.
includes ( ) Include required core files used in admin and on the frontend.
init ( ) Init WooCommerce when WordPress Initialises.
instance ( ) : WooCommerce Main WooCommerce Instance.
load_plugin_textdomain ( ) Load Localisation files.
mailer ( ) : WC_Emails Email Class.
payment_gateways ( ) : WC_Payment_Gateways Get gateways class.
plugin_path ( ) : string Get the plugin path.
plugin_url ( ) : string Get the plugin url.
setup_environment ( ) Ensure theme and server variable compatibility and setup image sizes.
shipping ( ) : WC_Shipping Get shipping class.
template_path ( ) : string Get the template path.
wpdb_table_fix ( ) WooCommerce Payment Token Meta API and Term/Order item Meta - set table names.

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

Метод Описание
add_image_sizes ( ) Add WC Image sizes to WP.
add_thumbnail_support ( ) Ensure post thumbnail support is turned on.
define ( string $name, string | boolean $value ) Define constant if not already set.
define_constants ( ) Define WC Constants.
init_hooks ( ) Hook into actions and filters.
is_request ( string $type ) : boolean What type of request is this?
load_webhooks ( ) Load & enqueue active webhooks.

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

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

Cloning is forbidden.
С версии: 2.1
public __clone ( )

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

WooCommerce Constructor.
public __construct ( )

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

Auto-load in-accessible properties on demand.
public __get ( mixed $key ) : mixed
$key mixed
Результат mixed

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

Unserializing instances of this class is forbidden.
С версии: 2.1
public __wakeup ( )

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

Get Ajax URL.
public ajax_url ( ) : string
Результат string

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

Return the WC API URL for a given request.
public api_request_url ( string $request, mixed $ssl = null ) : string
$request string
$ssl mixed (default: null)
Результат string

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

Get Checkout Class.
public checkout ( ) : WC_Checkout
Результат WC_Checkout

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

Include required frontend files.
public frontend_includes ( )

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

Function used to Init WooCommerce Template Functions - This makes them pluggable by plugins and themes.

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

Include required core files used in admin and on the frontend.
public includes ( )

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

Init WooCommerce when WordPress Initialises.
public init ( )

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

Ensures only one instance of WooCommerce is loaded or can be loaded.
См. также: WC()
С версии: 2.1
public static instance ( ) : WooCommerce
Результат WooCommerce - Main instance.

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

Note: the first-loaded translation file overrides any following ones if the same translation is present. Locales found in: - WP_LANG_DIR/woocommerce/woocommerce-LOCALE.mo - WP_LANG_DIR/plugins/woocommerce-LOCALE.mo

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

Email Class.
public mailer ( ) : WC_Emails
Результат WC_Emails

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

Get gateways class.
public payment_gateways ( ) : WC_Payment_Gateways
Результат WC_Payment_Gateways

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

Get the plugin path.
public plugin_path ( ) : string
Результат string

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

Get the plugin url.
public plugin_url ( ) : string
Результат string

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

Ensure theme and server variable compatibility and setup image sizes.
public setup_environment ( )

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

Get shipping class.
public shipping ( ) : WC_Shipping
Результат WC_Shipping

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

Get the template path.
public template_path ( ) : string
Результат string

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

WooCommerce Payment Token Meta API and Term/Order item Meta - set table names.
public wpdb_table_fix ( )

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

$_instance защищенное статическое свойство

The single instance of the class.
С версии: 2.1
protected static WooCommerce $_instance
Результат WooCommerce

$cart публичное свойство

Cart instance.
public WC_Cart $cart
Результат WC_Cart

$countries публичное свойство

Countries instance.
public WC_Countries $countries
Результат WC_Countries

$customer публичное свойство

Customer instance.
public WC_Customer $customer
Результат WC_Customer

$integrations публичное свойство

Integrations instance.
public WC_Integrations $integrations
Результат WC_Integrations

$order_factory публичное свойство

Order factory instance.
public WC_Order_Factory $order_factory
Результат WC_Order_Factory

$product_factory публичное свойство

Product factory instance.
public WC_Product_Factory $product_factory
Результат WC_Product_Factory

$query публичное свойство

Query instance.
public WC_Query $query
Результат WC_Query

$session публичное свойство

Session instance.
public WC_Session $session
Результат WC_Session

$structured_data публичное свойство

Structured data instance.
public WC_Structured_Data $structured_data
Результат WC_Structured_Data

$version публичное свойство

WooCommerce version.
public string $version
Результат string