I'm trying to display product description and variation description:
1. In the order received page and emails
I'm using Woocommerce: Display Product Variation Description on order page answer code.
This code works for v5.3 but now product quantity moved at the end of the decription -> https://prnt.sc/12yc7l4.
This is my attempt to solve the problem.
add_filter( 'woocommerce_order_item_name', 'display_product_title_as_link', 10, 3 );
function display_product_title_as_link( $item_name, $item ,$qty) {
$_product = get_product( $item['variation_id'] ? $item['variation_id'] : $item['product_id'] );
$link = get_permalink( $_product->id );
$_var_description ='';
if ( $item['variation_id'] ) {
$_var_description = $_product->get_variation_description();
}
return '<a href="'. $link .'" rel="nofollow">'. $item_name .'</a>'. $qty .'<br>'. $_var_description ;
}
How can I apply this so that it has no influence between the product name and the product quantity?
2. in cart, mini cart and checkout page - i'm using WooCommerce: Display also product variation description on cart items answer code
Using this lines works for v5.3 but now the description completely replaces the product name while it would be useful if the product description were added to the product name. How can I fix it?
EDIT: issue 2 is fixed!