2015-03-13 88 views

回答

3

這樣的事情?

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>'; 
} 

此代碼將在產品名稱下方顯示類別。

+0

順便說一句:$ product-> id應該是$ item ['product_id'] – Cudos 2015-03-27 10:16:34

+0

工作很好,謝謝 – 2017-09-23 21:11:32

+0

請問您可以檢查這個https://stackoverflow.com/questions/47766480/woocommerce-custom-shop-page -with-infinte負荷 – 2017-12-12 09:54:09

相關問題