PHP Class WooCommerce

Afficher le fichier Open project: woocommerce/woocommerce Class Usage Examples

Méthodes publiques

Свойство 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

Свойство Type Description
$_instance WooCommerce The single instance of the class.

Méthodes publiques

Méthode 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

Méthode 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 méthode

Cloning is forbidden.
Since: 2.1
public __clone ( )

__construct() public méthode

WooCommerce Constructor.
public __construct ( )

__get() public méthode

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

__wakeup() public méthode

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

ajax_url() public méthode

Get Ajax URL.
public ajax_url ( ) : string
Résultat string

api_request_url() public méthode

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)
Résultat string

checkout() public méthode

Get Checkout Class.
public checkout ( ) : WC_Checkout
Résultat WC_Checkout

frontend_includes() public méthode

Include required frontend files.
public frontend_includes ( )

include_template_functions() public méthode

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

includes() public méthode

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

init() public méthode

Init WooCommerce when WordPress Initialises.
public init ( )

instance() public static méthode

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

load_plugin_textdomain() public méthode

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 méthode

Email Class.
public mailer ( ) : WC_Emails
Résultat WC_Emails

payment_gateways() public méthode

Get gateways class.
public payment_gateways ( ) : WC_Payment_Gateways
Résultat WC_Payment_Gateways

plugin_path() public méthode

Get the plugin path.
public plugin_path ( ) : string
Résultat string

plugin_url() public méthode

Get the plugin url.
public plugin_url ( ) : string
Résultat string

setup_environment() public méthode

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

shipping() public méthode

Get shipping class.
public shipping ( ) : WC_Shipping
Résultat WC_Shipping

template_path() public méthode

Get the template path.
public template_path ( ) : string
Résultat string

wpdb_table_fix() public méthode

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
Résultat WooCommerce

$cart public_oe property

Cart instance.
public WC_Cart $cart
Résultat WC_Cart

$countries public_oe property

Countries instance.
public WC_Countries $countries
Résultat WC_Countries

$customer public_oe property

Customer instance.
public WC_Customer $customer
Résultat WC_Customer

$integrations public_oe property

Integrations instance.
public WC_Integrations $integrations
Résultat WC_Integrations

$order_factory public_oe property

Order factory instance.
public WC_Order_Factory $order_factory
Résultat WC_Order_Factory

$product_factory public_oe property

Product factory instance.
public WC_Product_Factory $product_factory
Résultat WC_Product_Factory

$query public_oe property

Query instance.
public WC_Query $query
Résultat WC_Query

$session public_oe property

Session instance.
public WC_Session $session
Résultat WC_Session

$structured_data public_oe property

Structured data instance.
public WC_Structured_Data $structured_data
Résultat WC_Structured_Data

$version public_oe property

WooCommerce version.
public string $version
Résultat string