This is related to : Replace product "on backorder" to a custom field value in Woocommerce
I would like to display the _backorder_text product custom field value in cart items that are backordered.
Based on Admin product pages custom field displayed in Cart and checkout, Here is the code that I have:
// Render meta on cart and checkout
add_filter( 'woocommerce_get_item_data', 'rendering_meta_field_on_cart_and_checkout', 10, 2 );
function rendering_meta_field_on_cart_and_checkout( $cart_item_data, $cart_item ) {
if( isset( $cart_item['_backorder_text'] ) ) {
$cart_item_data[] = array(
"name" => __( "Backorders text", "woocommerce" ),
"value" => $cart_item['_backorder_text']
);
}
return $cart_item_data;
}
But it doesn't work.
Any help is appreciated.