WC_Abstract_Order class. Legacy and deprecated functions are here to keep the WC_Abstract_Order clean. This class will be removed in future versions. Table of Contents $cache_group : string Stores meta in cache for future reads. $changes : array Core data changes for this object. $data :.
WC_Abstract_Order::__construct() Get the order if ID is passed, otherwise the order is new and empty. WC_Abstract_Order::add_item() Adds an order item to this order. The.
* WC_ Abstract _Order class. */ abstract class WC_ Abstract _Order extends WC_Abstract_Legacy_Order {use WC_Item_Totals; /** * Order Data array. This is the core order data exposed in APIs since 3.0.0. * * Notes: cart_tax = cart_tax is the new name for the legacy ‘order_tax’, / WC_ Abstract _Order::update_taxes() Update tax lines for the order based on the line item taxes themselves. You appear to be a bot. Output may be restricted Description, Gets line subtotal – formatted for display.
includes/interfaces/class-wc- abstract -order-data-store-interface.php: 9. Order Data Store Interface. Tags version 3.0.0 Table of Contents delete_items() : mixed …
abstract class Abstract_WC_Order_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Data_Store_Interface, WC_Abstract_Order_Data_Store_Interface {/** * Internal meta type used to store order data. * * @var string */ protected $ meta_type = ‘post’; /** * Data stored in meta keys, but not considered meta for an order. * * @since 3.0.0 * @var array */, Since WooCommerce 3 your code is outdated and can be simplified using some WC_ Abstract _Order methods. Also you should better use woocommerce_checkout_order_created hook instead, that is triggered after order is created:, New WC_Order and WC_Abstract_Order getter and setter methods are now required on the WC_Order object instance. Also, there are some New classes for Order items: WC_Order_Item class, WC_Order_Item_Product class, WC_Order_Item_Tax class, WC_Order_Item_Shipping class, WC_Order_Item_Coupon class, WC_Order_Item_Fee class.
Most of the time this should mark an order as ‘processing’ so that admin can process/post the items. If the cart contains only downloadable items then the order is