PHP Class WooCommerce

Mostrar archivo Open project: woocommerce/woocommerce Class Usage Examples

Public Properties

Property Type Description
$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 Properties

Property Type Description
$_instance WooCommerce The single instance of the class.

Public Methods

Method Description
__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.

Private Methods

Method Description
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.

Method Details

__clone() public method

Cloning is forbidden.
Since: 2.1
public __clone ( )

__construct() public method

WooCommerce Constructor.
public __construct ( )

__get() public method

Auto-load in-accessible properties on demand.
public __get ( mixed $key ) : mixed
$key mixed
return mixed

__wakeup() public method

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

ajax_url() public method

Get Ajax URL.
public ajax_url ( ) : string
return string

api_request_url() public method

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)
return string

checkout() public method

Get Checkout Class.
public checkout ( ) : WC_Checkout
return WC_Checkout

frontend_includes() public method

Include required frontend files.
public frontend_includes ( )

include_template_functions() public method

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

includes() public method

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

init() public method

Init WooCommerce when WordPress Initialises.
public init ( )

instance() public static method

Ensures only one instance of WooCommerce is loaded or can be loaded.
See also: WC()
Since: 2.1
public static instance ( ) : WooCommerce
return WooCommerce - Main instance.

load_plugin_textdomain() public method

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() public method

Email Class.
public mailer ( ) : WC_Emails
return WC_Emails

payment_gateways() public method

Get gateways class.
public payment_gateways ( ) : WC_Payment_Gateways
return WC_Payment_Gateways

plugin_path() public method

Get the plugin path.
public plugin_path ( ) : string
return string

plugin_url() public method

Get the plugin url.
public plugin_url ( ) : string
return string

setup_environment() public method

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

shipping() public method

Get shipping class.
public shipping ( ) : WC_Shipping
return WC_Shipping

template_path() public method

Get the template path.
public template_path ( ) : string
return string

wpdb_table_fix() public method

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

Property Details

$_instance protected_oe static_oe property

The single instance of the class.
Since: 2.1
protected static WooCommerce $_instance
return WooCommerce

$cart public_oe property

Cart instance.
public WC_Cart $cart
return WC_Cart

$countries public_oe property

Countries instance.
public WC_Countries $countries
return WC_Countries

$customer public_oe property

Customer instance.
public WC_Customer $customer
return WC_Customer

$integrations public_oe property

Integrations instance.
public WC_Integrations $integrations
return WC_Integrations

$order_factory public_oe property

Order factory instance.
public WC_Order_Factory $order_factory
return WC_Order_Factory

$product_factory public_oe property

Product factory instance.
public WC_Product_Factory $product_factory
return WC_Product_Factory

$query public_oe property

Query instance.
public WC_Query $query
return WC_Query

$session public_oe property

Session instance.
public WC_Session $session
return WC_Session

$structured_data public_oe property

Structured data instance.
public WC_Structured_Data $structured_data
return WC_Structured_Data

$version public_oe property

WooCommerce version.
public string $version
return string