WC_Order_Item_Product::set_backorder_meta()publicWC 1.0

Set meta data for backordered products.

Method of the class: WC_Order_Item_Product{}

Return

null. Nothing (null).

Usage

$WC_Order_Item_Product = new WC_Order_Item_Product();
$WC_Order_Item_Product->set_backorder_meta();

WC_Order_Item_Product::set_backorder_meta() code WC 8.7.0

public function set_backorder_meta() {
	$product = $this->get_product();
	if ( $product && $product->backorders_require_notification() && $product->is_on_backorder( $this->get_quantity() ) ) {
		$this->add_meta_data( apply_filters( 'woocommerce_backordered_item_meta_name', __( 'Backordered', 'woocommerce' ), $this ), $this->get_quantity() - max( 0, $product->get_stock_quantity() ), true );
	}
}