반응형
현재 woocommerce 주문 배송 방법 ID에 접속하려면 어떻게 해야 하나요?
방법을 찾았습니다.
$order->get_shipping_method()
이름 대신 아이디를 불러오고 싶은데?
누군가 나와 같은 문제에 부딪히면 어떻게 해결할 수 있는지 알려주려고 했어요$Order 변수에 WC_Order가 있습니다.
$order->get_items( 'shipping' );
그러면 이름, 유형, method_id, 비용 및 세금이 포함된 배열이 나타납니다.
$shipping_method = @array_shift($order->get_shipping_methods());
$shipping_method_id = $shipping_method['method_id'];
언급URL : https://stackoverflow.com/questions/26126438/how-can-i-access-current-woocommerce-order-shipping-method-id
반응형
'programing' 카테고리의 다른 글
| JSONObject 요소 업데이트 (0) | 2023.03.15 |
|---|---|
| 테스트 실행 시 스프링 부트 "PSQLException: FATAL: 미안, 너무 많은 클라이언트" (0) | 2023.03.15 |
| 각도 내 D3JS 앱 (0) | 2023.03.15 |
| JSON 문자열을 사전으로 역직렬화 (0) | 2023.03.15 |
| 배송 메서드를 가져오는 동안 Woocommerce가 빈 어레이 목록을 반환하는 중 (0) | 2023.03.15 |