You are indeed using the correct hook, but you have access to 3 passed arguments (opposite 2). Namely: $item_id
, $item
& $product
Note: Because a variable product can only have 1 product short description, so all product variations would have exactly the same description. You can display the product variation description instead of product short description for variable products
So you get:
function action_woocommerce_before_order_itemmeta( $item_id, $item, $product ) {
// Targeting line items type only
if ( $item->get_type() !== 'line_item' ) return;
// Variable
if ( $product->get_type() == 'variation' ) {
// Get the variable product description
$description = $product->get_description();
} else {
// Get product short desciption
$description = $product->get_short_description();
}
// Isset & NOT empty
if ( isset ( $description ) && ! empty( $description ) ) {
echo $description;
}
}
add_action( 'woocommerce_before_order_itemmeta', 'action_woocommerce_before_order_itemmeta', 10, 3 );
Result: