WC_Order_Item_Product::set_backorder_meta
Set meta data for backordered products.
Method of the class: WC_Order_Item_Product{}
Hooks from the method
Returns
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() WC Order Item Product::set backorder meta code WC 10.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 );
}
}