[英]WooCommerce Short_Description in details order before product title
我在詳細信息順序中使用Woocommerce Short_Description
不幸的是,產品的簡短描述顯示在第二位。
但我首先需要簡短的產品描述!
我該怎么做/代碼應該是什么?
自助解決問題
add_filter( 'woocommerce_order_item_name', 'add_single_excerpt_to_order_item', 10, 3 );
function add_single_excerpt_to_order_item( $item_name, $item, $is_visible ){
$product_id = $item->get_product_id(); // Get the product Id
$excerpt = get_the_excerpt( $product_id ); // Get the short description
return $excerpt . $item_name;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.