PHP 클래스 WC_Abstract_Legacy_Order

Legacy and deprecated functions are here to keep the WC_Abstract_Order clean. This class will be removed in future versions.
저자: WooThemes
상속: extends WC_Data
파일 보기 프로젝트 열기: woocommerce/woocommerce 1 사용 예제들

공개 메소드들

메소드 설명
__get ( string $key ) : mixed Magic __get method for backwards compatibility.
__isset ( string $key ) : boolean Magic __isset method for backwards compatibility.
add_coupon ( string $code = [], integer $discount, integer $discount_tax ) : integer Add coupon code to the order.
add_fee ( object $fee ) : integer Add a fee to the order.
add_shipping ( $shipping_rate ) : integer Add a shipping row to the order.
add_tax ( $tax_rate_id, integer $tax_amount, integer $shipping_tax_amount ) : integer Add a tax row to the order.
cancel_order ( string $note = '' ) Cancel the order and restore the cart (before payment).
decrease_coupon_usage_counts ( ) Decrease applied coupon counts.
display_item_downloads ( array $item ) Display download links for an order item.
display_item_meta ( array $item ) Display meta data belonging to an item.
email_order_items_table ( array $args = [] ) : string Output items for display in html emails.
expand_item_meta ( array $item ) : array Expand item meta into the $item array.
get_download_url ( integer $product_id, integer $download_id ) : string Get the Download URL.
get_item_downloads ( array $item ) : array Get the downloadable files for an item in this order.
get_item_meta ( mixed $order_item_id, string $key = '', boolean $single = false ) : array | string Get order item meta.
get_item_meta_array ( mixed $order_item_id ) : array Get all item meta data in array format in the order it was saved. Does not group meta by key like get_item_meta().
get_order ( integer $id ) : boolean Gets an order from the database.
get_order_currency ( ) Get currency.
get_product_from_item ( object $item ) : WC_Product | boolean Get a product (either product or variation).
get_total_shipping ( ) : float Gets shipping total. Alias of WC_Order::get_shipping_total().
has_meta ( string $order_item_id ) : array has_meta function for order items.
increase_coupon_usage_counts ( ) Increase applied coupon counts.
legacy_set_total ( float $amount, string $total_type = 'total' ) : boolean Set an order total.
populate ( mixed $result ) Populates an order from the loaded post data.
record_product_sales ( ) Record sales.
reduce_order_stock ( ) Reduce stock levels for all line items in the order.
send_stock_notifications ( $product, $new_stock, $qty_ordered ) Send the stock notifications.
set_address ( array $address, string $type = 'billing' ) Set the customer address.
update_coupon ( object | integer $item, array $args ) : integer Update coupon for order. Note this does not update order totals.
update_fee ( object | integer $item, array $args ) : integer Update fee for order.
update_product ( object | integer $item, WC_Product $product, array $args ) : integer Update a line item for the order.
update_shipping ( object | integer $item, array $args ) : integer Update shipping method for order.
update_tax ( object | integer $item, array $args ) : integer Update tax line on order.

보호된 메소드들

메소드 설명
init ( integer | object | WC_Order $order ) Load the order object. Called from the constructor.

메소드 상세

__get() 공개 메소드

Magic __get method for backwards compatibility.
public __get ( string $key ) : mixed
$key string
리턴 mixed

__isset() 공개 메소드

Magic __isset method for backwards compatibility.
public __isset ( string $key ) : boolean
$key string
리턴 boolean

add_coupon() 공개 메소드

Add coupon code to the order.
public add_coupon ( string $code = [], integer $discount, integer $discount_tax ) : integer
$code string
$discount integer tax amount.
$discount_tax integer amount.
리턴 integer order item ID

add_fee() 공개 메소드

Order must be saved prior to adding items.
public add_fee ( object $fee ) : integer
$fee object
리턴 integer updated order item ID

add_shipping() 공개 메소드

Add a shipping row to the order.
public add_shipping ( $shipping_rate ) : integer
리턴 integer order item ID

add_tax() 공개 메소드

Add a tax row to the order.
public add_tax ( $tax_rate_id, integer $tax_amount, integer $shipping_tax_amount ) : integer
$tax_amount integer amount of tax.
$shipping_tax_amount integer shipping amount.
리턴 integer order item ID

cancel_order() 공개 메소드

Cancel the order and restore the cart (before payment).
사용 중단: 2.7.0 Moved to event handler.
public cancel_order ( string $note = '' )
$note string (default: '') Optional note to add.

decrease_coupon_usage_counts() 공개 메소드

Decrease applied coupon counts.
사용 중단: 2.7.0

display_item_downloads() 공개 메소드

Display download links for an order item.
public display_item_downloads ( array $item )
$item array

display_item_meta() 공개 메소드

Display meta data belonging to an item.
public display_item_meta ( array $item )
$item array

email_order_items_table() 공개 메소드

Output items for display in html emails.
사용 중단: 2.7.0 Moved to template functions.
public email_order_items_table ( array $args = [] ) : string
$args array Items args.
리턴 string

expand_item_meta() 공개 메소드

Expand item meta into the $item array.
사용 중단: 2.7.0 Item meta no longer expanded due to new order item classes. This function now does nothing to avoid data breakage.
public expand_item_meta ( array $item ) : array
$item array before expansion.
리턴 array

get_download_url() 공개 메소드

Get the Download URL.
public get_download_url ( integer $product_id, integer $download_id ) : string
$product_id integer
$download_id integer
리턴 string

get_item_downloads() 공개 메소드

Get the downloadable files for an item in this order.
public get_item_downloads ( array $item ) : array
$item array
리턴 array

get_item_meta() 공개 메소드

Get order item meta.
사용 중단: 2.7.0
public get_item_meta ( mixed $order_item_id, string $key = '', boolean $single = false ) : array | string
$order_item_id mixed
$key string (default: '')
$single boolean (default: false)
리턴 array | string

get_item_meta_array() 공개 메소드

Get all item meta data in array format in the order it was saved. Does not group meta by key like get_item_meta().
public get_item_meta_array ( mixed $order_item_id ) : array
$order_item_id mixed
리턴 array of objects

get_order() 공개 메소드

Gets an order from the database.
사용 중단: 2.7
public get_order ( integer $id ) : boolean
$id integer (default: 0).
리턴 boolean

get_order_currency() 공개 메소드

Get currency.
사용 중단: 2.7.0
public get_order_currency ( )

get_product_from_item() 공개 메소드

Get a product (either product or variation).
사용 중단: Add deprecation notices in future release. Replaced with $item->get_product()
public get_product_from_item ( object $item ) : WC_Product | boolean
$item object
리턴 WC_Product | boolean

get_total_shipping() 공개 메소드

Gets shipping total. Alias of WC_Order::get_shipping_total().
사용 중단: 2.7.0 since this is an alias only.
public get_total_shipping ( ) : float
리턴 float

has_meta() 공개 메소드

has_meta function for order items.
public has_meta ( string $order_item_id ) : array
$order_item_id string
리턴 array of meta data.

increase_coupon_usage_counts() 공개 메소드

Increase applied coupon counts.
사용 중단: 2.7.0

init() 보호된 메소드

Load the order object. Called from the constructor.
사용 중단: 2.7.0 Logic moved to constructor
protected init ( integer | object | WC_Order $order )
$order integer | object | WC_Order Order to init.

legacy_set_total() 공개 메소드

Set an order total.
public legacy_set_total ( float $amount, string $total_type = 'total' ) : boolean
$amount float
$total_type string
리턴 boolean

populate() 공개 메소드

Populates an order from the loaded post data.
사용 중단: 2.7
public populate ( mixed $result )
$result mixed

record_product_sales() 공개 메소드

Record sales.
사용 중단: 2.7.0

reduce_order_stock() 공개 메소드

Reduce stock levels for all line items in the order.
사용 중단: 2.7.0
public reduce_order_stock ( )

send_stock_notifications() 공개 메소드

Send the stock notifications.
사용 중단: 2.7.0 No longer needs to be called directly.
public send_stock_notifications ( $product, $new_stock, $qty_ordered )

set_address() 공개 메소드

Set the customer address.
public set_address ( array $address, string $type = 'billing' )
$address array Address data.
$type string billing or shipping.

update_coupon() 공개 메소드

Update coupon for order. Note this does not update order totals.
public update_coupon ( object | integer $item, array $args ) : integer
$item object | integer
$args array
리턴 integer updated order item ID

update_fee() 공개 메소드

Note this does not update order totals.
public update_fee ( object | integer $item, array $args ) : integer
$item object | integer
$args array
리턴 integer updated order item ID

update_product() 공개 메소드

Note this does not update order totals.
public update_product ( object | integer $item, WC_Product $product, array $args ) : integer
$item object | integer order item ID or item object.
$product WC_Product
$args array data to update.
리턴 integer updated order item ID

update_shipping() 공개 메소드

Note this does not update the order total.
public update_shipping ( object | integer $item, array $args ) : integer
$item object | integer
$args array
리턴 integer updated order item ID

update_tax() 공개 메소드

Note this does not update order totals.
부터: 2.7
public update_tax ( object | integer $item, array $args ) : integer
$item object | integer
$args array
리턴 integer updated order item ID