在管理员的订单页面添加产品类别名称
Add product category name on order page in admin
有没有办法将产品类别名称添加到 Woocommerce 的管理订单页面?
目前只显示产品名称。
类似这样的东西??
add_action('woocommerce_before_order_itemmeta','woocommerce_before_order_itemmeta',10,3);
function woocommerce_before_order_itemmeta($item_id, $item, $product){
echo '<p>'.get_the_term_list($product->id, 'product_cat').'</p>';
}
此代码将在产品名称下方显示类别。
有没有办法将产品类别名称添加到 Woocommerce 的管理订单页面?
目前只显示产品名称。
类似这样的东西??
add_action('woocommerce_before_order_itemmeta','woocommerce_before_order_itemmeta',10,3);
function woocommerce_before_order_itemmeta($item_id, $item, $product){
echo '<p>'.get_the_term_list($product->id, 'product_cat').'</p>';
}
此代码将在产品名称下方显示类别。