2017-01-25 7 views
-1

https://postimg.org/image/xgyc0hgxz/는 주문 세부 후 [Woocommerce]가

확인 후크. 검색 후 난 후크

woocommerce_admin_order_data_after_order_details 

를 찾았지만이 후크는 .. 여기 가리 켰을 때, 내가 원하는 무엇보다 내가 원하는 것은 내가 통해 액세스 할 수도있을 것 같군요 각 개체에 대해 운송 클래스를 보여주는 것입니다 또한 Add order metadata to WooCommerce admin order overview

입니다 글로벌 $ 제품 만약 내가 거기에 루프에 액세스 할 수 있지만 난 그냥 후크 모르거나이 열을 추가하는 방법을 가정합니다. 어떤 아이디어?

답변

1

좋아요. 해결책을 찾았습니다. 그리고 다른 사람이 이것을 찾고 있습니다.

add_action('woocommerce_before_order_itemmeta','woocommerce_before_order_itemmeta',10,3); 
function woocommerce_before_order_itemmeta($item_id, $item, $product){ 
    $shippingclass = $product->get_shipping_class(); 

    echo ($shippingclass) ? __('<hr><b>Shipping with: </b> <i style = "text-transform:uppercase">'. $shippingclass .'</i><hr>','woocommerce') : 'No Shipping Class is assigned to this product'; 
    echo '<p><b>Category:</b> <i>'.get_the_term_list($product->id, 'product_cat').'</i></p>'; 
}